Skip to content

Commit 5fc1cd8

Browse files
committedOct 27, 2017
Add sponsor link and put all migration docs in one file
1 parent cfb13c0 commit 5fc1cd8

File tree

2 files changed

+27
-15
lines changed

2 files changed

+27
-15
lines changed
 

‎README.md

+8-12
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,17 @@ Finally, the URL query parameters will be checked for a field matching either
151151
`options.tokenQueryParameterName` or `auth_token` if the option was not
152152
specified.
153153

154-
## Migrating from 2.x.x to 3.x.x
154+
## Supporters
155155

156-
Version 3.0.0 removes the `ExtractJwt.fromAuthHeader()` extractor function that would extract
157-
JWT's from `Authorization` headers with the auth scheme 'jwt'. The default authorization scheme
158-
of 'jwt' as the was not RFC 6750 compliant. The extractor was replaced with
159-
`ExtractJwt.fromAuthHeaderAsBearerToken()`. The removal of `ExtractJwt.fromAuthHeader()` was done
160-
to clearly change the API so any code relying on the old API would clearly break, hopefully saving
161-
people some debugging time.
156+
This project is supported by
157+
![](http://passportjs.org/images/supported_logo.svg) [Auth0](https://auth0.com)
162158

163-
If you want to maintain the behavior of `ExtractJwt.fromAuthHeader()` when switching to v3.3.0, simply
164-
replace it with `ExtractJwt.fromAuthHeaderWithScheme('jwt')` in your implementation.
159+
If you want to quickly add secure token-based authentication to Node.js apps, feel free to check out Auth0's Node.js SDK and free plan at [auth0.com/overview](https://auth0.com/overview?utm_source=GHsponsor&utm_medium=GHsponsor&utm_campaign=passport-jwt&utm_content=auth)
165160

166-
## Migrating from version 1.x.x to 2.x.x
167-
168-
See [the guide for migrating from v1 to v2](docs/migrating_v1_to_v2.md) for explanation of the major changes.
161+
## Migrating
162+
163+
The the [Migration Guide](docs/migrating.md) for help upgrading to the latest
164+
major version of passport-jwt
169165

170166
## Tests
171167

‎docs/migrating_v1_to_v2.md ‎docs/migrating.md

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
# Migrating from version 1.x.x to 2.x.x
1+
# Migration Guide
2+
3+
The following instructions should help in migrating to a new major version of
4+
passport-jwt.
5+
6+
## Migrating from 2.x.x to 3.x.x
7+
8+
Version 3.0.0 removes the `ExtractJwt.fromAuthHeader()` extractor function that would extract
9+
JWT's from `Authorization` headers with the auth scheme 'jwt'. The default authorization scheme
10+
of 'jwt' as the was not RFC 6750 compliant. The extractor was replaced with
11+
`ExtractJwt.fromAuthHeaderAsBearerToken()`. The removal of `ExtractJwt.fromAuthHeader()` was done
12+
to clearly change the API so any code relying on the old API would clearly break, hopefully saving
13+
people some debugging time.
14+
15+
If you want to maintain the behavior of `ExtractJwt.fromAuthHeader()` when switching to v3.3.0, simply
16+
replace it with `ExtractJwt.fromAuthHeaderWithScheme('jwt')` in your implementation.
17+
18+
## Migrating from version 1.x.x to 2.x.x
19+
220
The v2 API is not backwards compatible with v1, specifically with regards to the introduction
321
of the concept of JWT extractor functions. If you require the legacy behavior in v1 you can use
422
the extractor function ```versionOneCompatibility(options)```
@@ -35,5 +53,3 @@ opts.issuer = 'accounts.examplesoft.com';
3553
opts.audience = 'yoursite.net';
3654
passport.use(new JwtStrategy(opts, verifyFunction));
3755
```
38-
39-

0 commit comments

Comments
 (0)
Please sign in to comment.