Skip to content

Commit

Permalink
Merge pull request #8 from GraemeFulton/patch-1
Browse files Browse the repository at this point in the history
Fix for when sanitizer removes user.email
  • Loading branch information
kucherenko committed Jul 13, 2022
2 parents e63d51a + 3c77e7e commit 390fca9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/services/passwordless.js
Expand Up @@ -163,7 +163,11 @@ module.exports = (
if (!user) {
return user;
}
return await sanitize.sanitizers.defaultSanitizeOutput(userSchema, user);
let sanitizedUser = await sanitize.sanitizers.defaultSanitizeOutput(userSchema, user);
if(!sanitizedUser.email && user.email){
sanitizedUser.email = user.email
}
return sanitizedUser
},

template(layout, data) {
Expand Down

0 comments on commit 390fca9

Please sign in to comment.