Skip to content

Commit

Permalink
Fix getCurrentAuthenticatedRoles when rolesJwtClaim is not found in j…
Browse files Browse the repository at this point in the history
…wtToken
  • Loading branch information
jreynard-code committed Jul 6, 2023
1 parent 2dcebda commit 4f90ab8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/kotlin/com/cosmotech/api/utils/SecurityUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ fun getCurrentAuthenticatedRoles(configuration: CsmPlatformProperties): List<Str
return getValueFromAuthenticatedToken {
JWTParser.parse(it).jwtClaimsSet.getStringListClaim(configuration.authorization.rolesJwtClaim)
}
?: emptyList()
}

fun <T> getValueFromAuthenticatedToken(actionLambda: (String) -> T): T {
Expand Down

0 comments on commit 4f90ab8

Please sign in to comment.