Skip to content

Commit

Permalink
Document complete option in README.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed May 15, 2015
1 parent 7254e01 commit ec32b20
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,18 @@ jwt.verify(token, cert, { algorithms: ['RS256'] }, function (err, payload) {
`options`:

* `json`: force JSON.parse on the payload even if the header doesn't contain `"typ":"JWT"`.
* `complete`: return an object with the decode payload and header.

Example

```js
// get the decoded payload ignoring signature, no secretOrPrivateKey needed
var decoded = jwt.decode(token);

// get the decoded payload and header
var decoded = jwt.decode(token);
console.log(decoded.header);
console.log(decoded.payload)
```

## Errors & Codes
Expand Down

0 comments on commit ec32b20

Please sign in to comment.