Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loading JWT when auth subject has no permissions #7894

Merged
merged 3 commits into from
Feb 18, 2023
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
Next Next commit
Fix an issue reported by Milos, when a JWT is loaded with a subject t…
…hat has no permissions
  • Loading branch information
sulkaharo committed Feb 16, 2023
commit 67e9829f413caaa8ba407260071bc3a06909e098
2 changes: 1 addition & 1 deletion lib/authorization/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ function init (env, ctx) {
const token = env.enclave.signJWT({ accessToken: subject.accessToken });
const decoded = env.enclave.verifyJWT(token);

var roles = _.uniq(subject.roles.concat(defaultRoles));
var roles = subject.roles ? _.uniq(subject.roles.concat(defaultRoles)) : defaultRoles;

authorized = {
token
Expand Down