Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Allow unknown properties on the JWT #139

Merged
merged 2 commits into from
May 12, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix joi validation on currentUser
  • Loading branch information
ThomasKranitsas committed May 12, 2019
commit a1238cc401859793e62ecd3f9f231030e2a2c822
6 changes: 5 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ _.forEach(routes, (verbs, path) => {
if (!req.authUser) {
return next(new errors.UnauthorizedError('Authorization failed.'));
}
req.currentUser = req.authUser;

req.currentUser = {
handle: _.get(req, 'authUser.handle', '').toLowerCase(),
roles: _.get(req, 'authUser.roles', [])
};

return next();
});
Expand Down