getToken reads the JWT token from the context.
(ctx context.Context)
| 44 | |
| 45 | // getToken reads the JWT token from the context. |
| 46 | func getToken(ctx context.Context) *jwt.Token { |
| 47 | obj := ctx.Value(tokenKey) |
| 48 | if obj == nil { |
| 49 | return nil |
| 50 | } |
| 51 | |
| 52 | return obj.(*jwt.Token) |
| 53 | } |
| 54 | |
| 55 | func getClaims(ctx context.Context) *AccessTokenClaims { |
| 56 | token := getToken(ctx) |