Fixed bug with 'undefined' token in email verification link

This commit is contained in:
Krzysztof Zielonka
2016-03-29 17:48:54 +02:00
parent 592334756b
commit 6dc7aa87c6
2 changed files with 56 additions and 3 deletions

View File

@@ -100,14 +100,13 @@ export class UserController extends AdaptableController {
})
}
sendVerificationEmail(user) {
if (!this.shouldVerifyEmails) {
return;
}
const token = encodeURIComponent(user._email_verify_token);
// We may need to fetch the user in case of update email
this.getUserIfNeeded(user).then((user) => {
const token = encodeURIComponent(user._email_verify_token);
const username = encodeURIComponent(user.username);
let link = `${this.config.verifyEmailURL}?token=${token}&username=${username}`;
let options = {