From 508040879e83a5a67df68d71a061def60c6d6e06 Mon Sep 17 00:00:00 2001 From: Tomaz Lovrec Date: Wed, 28 Feb 2018 17:17:42 +0100 Subject: [PATCH] Truly support jwtauth.Claims when parsing from context Previous change "fixed" the panic, but would silently remove all Claims, because the tokenClaims are not copied over to the claims variable. --- jwtauth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jwtauth.go b/jwtauth.go index 250066f..0e8df98 100644 --- a/jwtauth.go +++ b/jwtauth.go @@ -194,7 +194,7 @@ func FromContext(ctx context.Context) (*jwt.Token, Claims, error) { if token != nil { switch tokenClaims := token.Claims.(type) { case Claims: - // Nop. + claims = tokenClaims case jwt.MapClaims: claims = Claims(tokenClaims) default: