Merge pull request #151 from zaichang/FixMigrationGuide

Fixed migration guide request.ParseFromRequest example code
This commit is contained in:
Dave Grijalva 2016-07-29 09:48:51 -07:00 committed by GitHub
commit 63734eae1e
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"])
}
```