1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-22 12:27:02 +00:00

add auth/jwt/refresh-token example as requested at #1635

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-16 13:57:11 +03:00
parent 64f95a59b4
commit 85b5453ae1
3 changed files with 146 additions and 0 deletions

View File

@@ -476,6 +476,12 @@ func (j *JWT) VerifyToken(ctx *context.Context, claimsPtr interface{}) error {
}
}
return j.VerifyTokenString(ctx, token, claimsPtr)
}
// VerifyTokenString verifies and unmarshals an extracted token to "claimsPtr" destination.
// The Context is required when the claims validator needs it, otherwise can be nil.
func (j *JWT) VerifyTokenString(ctx *context.Context, token string, claimsPtr interface{}) error {
if token == "" {
return ErrMissing
}