Skip to content

Commit

Permalink
Truly support jwtauth.Claims when parsing from context
Browse files Browse the repository at this point in the history
Previous change "fixed" the panic, but would silently remove all Claims,
because the tokenClaims are not copied over to the claims variable.
  • Loading branch information
slax0rr committed Feb 28, 2018
1 parent fdeab96 commit 5080408
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jwtauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5080408

Please sign in to comment.