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.
This commit is contained in:
Tomaz Lovrec 2018-02-28 17:17:42 +01:00
parent fdeab96f74
commit 508040879e

View file

@ -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: