fix: handle failure on verifying token

This commit is contained in:
Derrick Hammer 2023-09-09 14:00:16 -04:00
parent ae071a30ec
commit a06b79a537
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 1 deletions

View File

@ -88,7 +88,12 @@ func generateAndSaveChallengeToken(accountID uint, maxAge time.Duration) (string
return "", ErrFailedGenerateToken return "", ErrFailedGenerateToken
} }
verifiedToken, _ := jwt.Verify(jwt.EdDSA, jwtKey, []byte(token), blocklist) verifiedToken, err := jwt.Verify(jwt.EdDSA, jwtKey, []byte(token), blocklist)
if err != nil {
return "", ErrFailedGenerateToken
}
var claim *jwt.Claims var claim *jwt.Claims
_ = verifiedToken.Claims(&claim) _ = verifiedToken.Claims(&claim)