diff --git a/src/config/roles.js b/src/config/roles.js index fb76ba61..dcf42c73 100644 --- a/src/config/roles.js +++ b/src/config/roles.js @@ -1,8 +1,10 @@ -const roles = ['user', 'admin']; +const allRoles = { + user: [], + admin: ['getUsers', 'manageUsers'], +}; -const roleRights = new Map(); -roleRights.set(roles[0], []); -roleRights.set(roles[1], ['getUsers', 'manageUsers']); +const roles = Object.keys(allRoles); +const roleRights = new Map(Object.entries(allRoles)); module.exports = { roles, diff --git a/src/services/token.service.js b/src/services/token.service.js index 89dda4f7..e5e8fba2 100644 --- a/src/services/token.service.js +++ b/src/services/token.service.js @@ -11,6 +11,7 @@ const { tokenTypes } = require('../config/tokens'); * Generate token * @param {ObjectId} userId * @param {Moment} expires + * @param {string} type * @param {string} [secret] * @returns {string} */