Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Commit

Permalink
Pull email from jwt.eml
Browse files Browse the repository at this point in the history
  • Loading branch information
cperryk committed Dec 13, 2017
1 parent 6c6ea9d commit 20dabc7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/nymag-auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const UserModel = require('../../models/user');

module.exports.tokenUserNotFound = ({jwt}) => {
const id = jwt.sub,
username = jwt.usn;
username = jwt.usn,
email = jwt.eml;

return UserModel.findOneAndUpdate({
id
Expand All @@ -22,7 +23,7 @@ module.exports.tokenUserNotFound = ({jwt}) => {
roles: [],
profiles: [{
provider: 'nymag',
id
id: email
}]
}, {
setDefaultsOnInsert: true,
Expand Down

0 comments on commit 20dabc7

Please sign in to comment.