Allow set user mapped from JWT directly on request (#6411)
* Use user mapped from JWT for Auth * Add a test for userFromJWT bypass Co-authored-by: Gordon Sun <gordon.sun@pipe17.com>
This commit is contained in:
@@ -183,6 +183,17 @@ export function handleParseHeaders(req, res, next) {
|
||||
delete info.sessionToken;
|
||||
}
|
||||
|
||||
if (req.userFromJWT) {
|
||||
req.auth = new auth.Auth({
|
||||
config: req.config,
|
||||
installationId: info.installationId,
|
||||
isMaster: false,
|
||||
user: req.userFromJWT,
|
||||
});
|
||||
next();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!info.sessionToken) {
|
||||
req.auth = new auth.Auth({
|
||||
config: req.config,
|
||||
|
||||
Reference in New Issue
Block a user