mirror of https://github.com/golang-jwt/jwt.git
Fixed issue #36 - out of date example code
This commit is contained in:
parent
d82ad649e4
commit
e1571c8f04
|
@ -19,7 +19,7 @@ This library supports the parsing and verification as well as the generation and
|
||||||
Parsing and verifying tokens is pretty straight forward. You pass in the token and a function for looking up the key. This is done as a callback since you may need to parse the token to find out what signing method and key was used.
|
Parsing and verifying tokens is pretty straight forward. You pass in the token and a function for looking up the key. This is done as a callback since you may need to parse the token to find out what signing method and key was used.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
token, err := jwt.Parse(myToken, func(token *jwt.Token) ([]byte, error) {
|
token, err := jwt.Parse(myToken, func(token *jwt.Token) (interface{}, error) {
|
||||||
return myLookupKey(token.Header["kid"])
|
return myLookupKey(token.Header["kid"])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue