Skip to content
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

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from

Conversation

Salil-Jain
Copy link
Contributor

Implements forgot password feature which allows users to change their passwords.

@Salil-Jain Salil-Jain changed the title Forgot password feature Forgot password feature #15579 Aug 1, 2018
@jdcc jdcc self-requested a review August 1, 2018 18:44
Copy link
Collaborator

@jdcc jdcc left a 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');
Copy link
Collaborator

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) {
Copy link
Collaborator

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);
Copy link
Collaborator

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) {
Copy link
Collaborator

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) {
Copy link
Collaborator

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).

@peter-hank peter-hank force-pushed the dev branch 6 times, most recently from 18c4e1e to 4167cce Compare May 31, 2024 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants