mirror of https://github.com/golang-jwt/jwt.git
Merge pull request #60 from glkz/master
Fix variable name in parse and verify example
This commit is contained in:
commit
38ff32c7bf
|
@ -21,8 +21,8 @@ Parsing and verifying tokens is pretty straight forward. You pass in the token
|
|||
```go
|
||||
token, err := jwt.Parse(myToken, func(token *jwt.Token) (interface{}, error) {
|
||||
// Don't forget to validate the alg is what you expect:
|
||||
if _, ok := t.Method.(*jwt.SigningMethodRSA); !ok {
|
||||
return nil, fmt.Errorf("Unexpected signing method: %v", t.Header["alg"])
|
||||
if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok {
|
||||
return nil, fmt.Errorf("Unexpected signing method: %v", token.Header["alg"])
|
||||
}
|
||||
return myLookupKey(token.Header["kid"])
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue