Skip to content

Commit

Permalink
Fix refresh token allowing access
Browse files Browse the repository at this point in the history
  • Loading branch information
Syer10 committed Aug 19, 2023
1 parent 729f91d commit bf43902
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ object Jwt {
try {
val decodedJWT = verifier.verify(jwt)

require(decodedJWT.getClaim("token_type").asString() == "access") {
"Cannot use refresh token to access"
}

val user = decodedJWT.subject.toInt()
val roles: List<String> = decodedJWT.getClaim("roles").asList(String::class.java)
val permissions: List<String> = decodedJWT.getClaim("permissions").asList(String::class.java)
Expand Down

0 comments on commit bf43902

Please sign in to comment.