Skip to content

Commit

Permalink
Fixed migration guide request.ParseFromRequest example code
Browse files Browse the repository at this point in the history
  • Loading branch information
zaichang authored and Zai Chang committed Jul 20, 2016
1 parent 01aeca5 commit 227c99f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
}
```

Expand Down

0 comments on commit 227c99f

Please sign in to comment.