Skip to content

Commit ec3e3de

Browse files
committed
Fixes README
1 parent 9231471 commit ec3e3de

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

README.md

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# node-jwt-wrapper
55
A promisified wrapper around the jsonwebtoken npm module that handles key ids.
6-
Uses bluebird promises.
6+
Uses native promises.
77

88
## Usage
99

@@ -38,25 +38,11 @@ jwtHandler.verify(jwtRaw)
3838
.then(jwtBody => {
3939
...
4040
})
41-
.catch(jwt.MissingKeyIdError, err => {
42-
// Handle MissingKeyIdError
43-
})
44-
.catch(jwt.UnknownKeyIdError, err => {
45-
// Handle UnknownKeyIdError
46-
})
47-
.catch(jwt.TokenExpiredError, err => {
48-
// Handle TokenExpiredError
49-
})
50-
.catch(jwt.NotBeforeError, err => {
51-
// Handle NotBeforeError
52-
})
53-
.catch(jwt.JsonWebTokenError, err => {
54-
// Handle other JWT related errors
55-
})
5641
.catch(err => {
57-
// Handle other errors
42+
// Handle errors
5843
})
5944

45+
6046
// Creating JWT tokens
6147
const keyId = 'keyid1'
6248
const tokenBody = { iat: Math.floor(Date.now() / 1000), sub: 'token subject', iss: 'issuer1', aud: 'audience1' }
@@ -65,11 +51,8 @@ jwtHandler.create(tokenBody, keyId)
6551
.then(jwt => {
6652
...
6753
})
68-
.catch(jwt.UnknownKeyIdError, err => {
69-
// Handle UnknownKeyIdError
70-
})
7154
.catch(err => {
72-
// Handle other errors
55+
// Handle errors
7356
})
7457
...
7558
```

0 commit comments

Comments
 (0)