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

Commit a1238cc

Browse files
Fix joi validation on currentUser
1 parent 77d0b2c commit a1238cc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/app.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ _.forEach(routes, (verbs, path) => {
6363
if (!req.authUser) {
6464
return next(new errors.UnauthorizedError('Authorization failed.'));
6565
}
66-
req.currentUser = req.authUser;
66+
67+
req.currentUser = {
68+
handle: _.get(req, 'authUser.handle', '').toLowerCase(),
69+
roles: _.get(req, 'authUser.roles', [])
70+
};
6771

6872
return next();
6973
});

0 commit comments

Comments
 (0)