From 20dabc73991f303bb0b68686582e71de98fa8d3f Mon Sep 17 00:00:00 2001 From: Chris Kirk Date: Wed, 13 Dec 2017 14:51:08 -0500 Subject: [PATCH] Pull email from jwt.eml --- plugins/nymag-auth/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/nymag-auth/index.js b/plugins/nymag-auth/index.js index f8821072ac..5703bf9550 100644 --- a/plugins/nymag-auth/index.js +++ b/plugins/nymag-auth/index.js @@ -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 @@ -22,7 +23,7 @@ module.exports.tokenUserNotFound = ({jwt}) => { roles: [], profiles: [{ provider: 'nymag', - id + id: email }] }, { setDefaultsOnInsert: true,