fix(auth): Add keyword in email support for passwordless

This commit is contained in:
Mrugesh Mohapatra
2017-11-29 23:11:24 +05:30
parent 71a3cc75e3
commit af43360027
2 changed files with 3 additions and 3 deletions

View File

@ -515,7 +515,7 @@ module.exports = function(User) {
.flatMap(token => { .flatMap(token => {
const { id: loginToken } = token; const { id: loginToken } = token;
const loginEmail = user.email; const loginEmail = new Buffer(user.email).toString('base64');
const host = getServerFullURL(); const host = getServerFullURL();
const mailOptions = { const mailOptions = {
type: 'email', type: 'email',

View File

@ -269,7 +269,7 @@ module.exports = function(app) {
} }
const authTokenId = req.query.token; const authTokenId = req.query.token;
const authEmailId = req.query.email; const authEmailId = new Buffer(req.query.email, 'base64').toString();
return AccessToken.findOne$({ where: {id: authTokenId} }) return AccessToken.findOne$({ where: {id: authTokenId} })
.map(authToken => { .map(authToken => {
@ -319,7 +319,7 @@ module.exports = function(app) {
return res.redirect('/email-signin'); return res.redirect('/email-signin');
} }
const email = req.query.email; const email = new Buffer(req.query.email, 'base64').toString();
return User.findOne$({ where: { email }}) return User.findOne$({ where: { email }})
.map(user => { .map(user => {