Skip to content

Commit ec32b20

Browse files
committed
Document complete option in README.
1 parent 7254e01 commit ec32b20

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,18 @@ jwt.verify(token, cert, { algorithms: ['RS256'] }, function (err, payload) {
137137
`options`:
138138

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

141142
Example
142143

143144
```js
144145
// get the decoded payload ignoring signature, no secretOrPrivateKey needed
145146
var decoded = jwt.decode(token);
147+
148+
// get the decoded payload and header
149+
var decoded = jwt.decode(token);
150+
console.log(decoded.header);
151+
console.log(decoded.payload)
146152
```
147153

148154
## Errors & Codes

0 commit comments

Comments
 (0)