Trim username and e-mail in login/registration form (#2888)
* Trim username and e-mail in login/registration form * Add trim to the sendConfirmationEmail and sendForgotPasswordEmailpull/3005/head
parent
b8c6e20885
commit
4de88df6b7
@ -1,8 +1,8 @@ |
||||
Meteor.methods |
||||
sendConfirmationEmail: (email) -> |
||||
user = RocketChat.models.Users.findOneByEmailAddress email |
||||
user = RocketChat.models.Users.findOneByEmailAddress s.trim(email) |
||||
|
||||
if user? |
||||
Accounts.sendVerificationEmail(user._id, email) |
||||
Accounts.sendVerificationEmail(user._id, s.trim(email)) |
||||
return true |
||||
return false |
||||
|
||||
@ -1,8 +1,8 @@ |
||||
Meteor.methods |
||||
sendForgotPasswordEmail: (email) -> |
||||
user = RocketChat.models.Users.findOneByEmailAddress email |
||||
user = RocketChat.models.Users.findOneByEmailAddress s.trim(email) |
||||
|
||||
if user? |
||||
Accounts.sendResetPasswordEmail(user._id, email) |
||||
Accounts.sendResetPasswordEmail(user._id, s.trim(email)) |
||||
return true |
||||
return false |
||||
|
||||
Loading…
Reference in new issue