Fixed migration guide request.ParseFromRequest example code

This commit is contained in:
Zai 2016-07-19 16:08:01 +02:00 committed by Zai Chang
parent 01aeca54eb
commit 227c99f1af
1 changed files with 3 additions and 2 deletions

View File

@ -56,8 +56,9 @@ This simple parsing example:
is directly mapped to:
```go
if token, err := request.ParseFromRequest(tokenString, request.OAuth2Extractor, req, keyLookupFunc); err == nil {
fmt.Printf("Token for user %v expires %v", token.Claims["user"], token.Claims["exp"])
if token, err := request.ParseFromRequest(req, request.OAuth2Extractor, keyLookupFunc); err == nil {
claims := token.Claims.(jwt.MapClaims)
fmt.Printf("Token for user %v expires %v", claims["user"], claims["exp"])
}
```