Skip to content

Commit

Permalink
fix: add support for authentik groups in allowedRoles
Browse files Browse the repository at this point in the history
  • Loading branch information
Creaous committed Apr 15, 2024
1 parent 82ec5fc commit 263befd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ export function useOIDC(options: OIDCPluginOptions): Plugin {

// Check if the token has the necessary roles
if (allowedRoles && allowedRoles.length > 0) {
const roles = JSON.parse(ct).realm_access.roles;
const roles =
JSON.parse(ct).realm_access.roles ||
JSON.parse(ct).groups;
if (
!roles.some((role: string) =>
allowedRoles.includes(role)
Expand Down

0 comments on commit 263befd

Please sign in to comment.