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

Fix create user error #1680

Merged
merged 3 commits into from
Jul 28, 2017
Merged

Conversation

canstudios-nicolaw
Copy link
Contributor

Fixes #1677

@canstudios-nicolaw canstudios-nicolaw added this to the 0.4.0 Refactor milestone Jul 18, 2017
LocalAuth.prototype.internalRegisterUser = function (user, cb) {
if (!user.email || !user.password || !user.retypePassword) {
LocalAuth.prototype.internalRegisterUser = function(retypePasswordRequired, user, cb) {
if (!user.email || !user.password) {
return cb(new auth.errors.UserRegistrationError('email, password and retyped password are required!'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to note this error message could now be misleading when there's no retyped password field:

retyped

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot I'll fix that now

if (user.password !== user.retypePassword) {
return cb(new auth.errors.UserRegistrationError('password and retyped password must match!'));
}
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers for amending. Can we lose the else here, unless I'm missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we can! 2 ticks

@taylortom taylortom merged commit 4a05f05 into adaptlearning:develop Jul 28, 2017
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.

4 participants