only keep userId in payload

This commit is contained in:
Martin McKeaveney 2021-04-22 14:53:19 +01:00
parent ad63faf448
commit 17d20b3faf
2 changed files with 1 additions and 3 deletions

View File

@ -119,7 +119,7 @@ const getConfigParams = ({ type, group, user }, otherProps = {}) => {
/** /**
* Returns the most granular configuration document from the DB based on the type, group and userID passed. * Returns the most granular configuration document from the DB based on the type, group and userID passed.
* @param {*} db - db instance to quer * @param {Object} db - db instance to query
* @param {Object} scopes - the type, group and userID scopes of the configuration. * @param {Object} scopes - the type, group and userID scopes of the configuration.
* @returns The most granular configuration document based on the scope. * @returns The most granular configuration document based on the scope.
*/ */

View File

@ -33,8 +33,6 @@ exports.authenticate = async function(email, password, done) {
if (await compare(password, dbUser.password)) { if (await compare(password, dbUser.password)) {
const payload = { const payload = {
userId: dbUser._id, userId: dbUser._id,
builder: dbUser.builder,
email: dbUser.email,
} }
dbUser.token = jwt.sign(payload, env.JWT_SECRET, { dbUser.token = jwt.sign(payload, env.JWT_SECRET, {