mirror of
https://github.com/vacp2p/nim-jwt.git
synced 2026-01-09 20:27:56 -05:00
Fixed compilation errors with newer nim
This commit is contained in:
@@ -57,7 +57,7 @@ proc toJWT*(node: JsonNode): JWT =
|
||||
|
||||
# Encodes the raw signature hex to b64url
|
||||
proc signatureToB64(token: JWT): string =
|
||||
assert token.signature != nil
|
||||
assert token.signature.len != 0
|
||||
result = encodeUrlSafe(token.signature)
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ proc verifySignature*(data: string, signature: string, secret: string): bool =
|
||||
|
||||
|
||||
proc sign*(token: var JWT, secret: string) =
|
||||
assert token.signature == nil
|
||||
assert token.signature.len == 0
|
||||
token.signature = signString(token.parsed, secret, token.header.alg)
|
||||
|
||||
|
||||
@@ -141,4 +141,4 @@ proc verifyTimeClaims*(token: JWT) =
|
||||
if now > exp :
|
||||
raise newException(InvalidToken, "Token is expired")
|
||||
|
||||
# Verify token nbf exp
|
||||
# Verify token nbf exp
|
||||
|
||||
Reference in New Issue
Block a user