mirror of
https://forgejo.merr.is/annika/jwtauth.git
synced 2025-12-11 13:47:41 -05:00
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:
parent
fdeab96f74
commit
508040879e
1 changed files with 1 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue