Fixes.
h3rald h3rald@h3rald.com
Fri, 29 Dec 2023 22:56:59 +0100
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
src/litestorepkg/lib/jwt.nim
→
src/litestorepkg/lib/jwt.nim
@@ -29,8 +29,8 @@ raise newException(ValueError, "JWKS file not found: " & file)
let keys = file.readFile.parseJson["keys"] if token.header.hasKey("kid"): let kid = token.header["kid"].getStr - return keys.filterIt(it["kid"].getStr == kid)[0]["x5c"].getStr - return keys[0]["x5c"].getStr + return keys.filterIt(it["kid"].getStr == kid)[0]["x5c"][0].getStr + return keys[0]["x5c"][0].getStr proc base64UrlDecode(encoded: string): string = let padding = 4 - (encoded.len mod 4)