fix(frontend,backend): Remove hardcoded legalconsenthub keycloak client ID
This commit is contained in:
@@ -21,7 +21,7 @@ export default defineOAuthKeycloakEventHandler({
|
||||
}
|
||||
|
||||
const organizations = decodedJwt ? extractOrganizations(decodedJwt) : []
|
||||
const roles = decodedJwt ? extractRoles(decodedJwt) : []
|
||||
const roles = decodedJwt ? extractRoles(decodedJwt, config.oauth.keycloak.clientId) : []
|
||||
|
||||
await setUserSession(event, {
|
||||
user: {
|
||||
@@ -71,6 +71,6 @@ function extractOrganizations(decoded: KeycloakTokenPayload): Organization[] {
|
||||
return organizations
|
||||
}
|
||||
|
||||
function extractRoles(decoded: KeycloakTokenPayload): string[] {
|
||||
return decoded?.resource_access?.legalconsenthub?.roles ?? []
|
||||
function extractRoles(decoded: KeycloakTokenPayload, clientId: string): string[] {
|
||||
return decoded?.resource_access?.[clientId]?.roles ?? []
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user