-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forgot password feature #15579 #95
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick pass with a few questions
import $ from 'jquery'; | ||
|
||
Accounts.onResetPasswordLink((token, done) => { | ||
Router.go('resetpwd'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you writing this manually instead of using one of the packages suggested in the Meteor docs?
Router.go('resetpwd'); | ||
}); | ||
|
||
if (Accounts._resetPasswordToken) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't have code that's sitting outside functions like this. I think this is only getting run when the file is first imported.
}); | ||
|
||
if (Accounts._resetPasswordToken) { | ||
Session.set('resetPasswordVar', Accounts._resetPasswordToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to do it this way, you could set both the token and the done callback as elements in the Session
object up after line 3.
Template.resetpwd.events({ | ||
'keypress #newpasswordconfirm': function (event, template) { | ||
event.which = event.which || event.keyCode; | ||
if (event.which === 13) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set 13
to a named constant so we know which key it is without having to look it up.
{ reason: 'Internal server error', message: 'Please check your internet connection.' }, | ||
]; | ||
const in1 = errorMessage.findIndex(x => x.reason === e.reason); | ||
if (in1 === -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be more readable as if (Object.keys(errorMessage).includes(e.reason)) {
(and then switch the condition).
18c4e1e
to
4167cce
Compare
Implements forgot password feature which allows users to change their passwords.