|
1 | | -koa-jwt |
2 | | -======= |
| 1 | +# koa-jwt |
3 | 2 |
|
4 | | -[![NPM version][npm-image]][npm-url] |
5 | | -[![build status][travis-image]][travis-url] |
6 | | -[![Coveralls][coveralls-image]][coveralls-url] |
7 | 3 | [![node version][node-image]][node-url] |
8 | 4 | [![npm download][download-image]][download-url] |
| 5 | +[![npm stats][npm-image]][npm-url] |
| 6 | +[![test status][travis-image]][travis-url] |
| 7 | +[![coverage][coveralls-image]][coveralls-url] |
9 | 8 | [![license][license-image]][license-url] |
10 | 9 |
|
11 | 10 | [npm-image]: https://img.shields.io/npm/v/koa-jwt.svg?maxAge=2592000&style=flat-square |
12 | 11 | [npm-url]: https://npmjs.org/package/koa-jwt |
13 | | -[travis-image]: https://img.shields.io/travis/koajs/jwt/koa-v2.svg?maxAge=2592000&style=flat-square |
| 12 | +[travis-image]: https://img.shields.io/travis/koajs/jwt/master.svg?maxAge=3600&style=flat-square |
14 | 13 | [travis-url]: https://travis-ci.org/koajs/jwt |
15 | | -[coveralls-image]: https://img.shields.io/coveralls/koajs/jwt/koa-v2.svg?maxAge=2592000&style=flat-square |
16 | | -[coveralls-url]: https://coveralls.io/r/koajs/jwt?branch=koa-v2 |
| 14 | +[coveralls-image]: https://img.shields.io/coveralls/koajs/jwt/master.svg?maxAge=2592000&style=flat-square |
| 15 | +[coveralls-url]: https://coveralls.io/r/koajs/jwt |
17 | 16 | [node-image]: https://img.shields.io/node/v/koa-jwt.svg?maxAge=2592000&style=flat-square |
18 | 17 | [node-url]: http://nodejs.org/download/ |
19 | 18 | [download-image]: https://img.shields.io/npm/dm/koa-jwt.svg?maxAge=2592000&style=flat-square |
20 | 19 | [download-url]: https://npmjs.org/package/koa-jwt |
21 | 20 | [license-image]: https://img.shields.io/npm/l/koa-jwt.svg?maxAge=2592000&style=flat-square |
22 | | -[license-url]: https://github.com/koajs/jwt/blob/koa-v2/LICENSE |
23 | | - |
24 | | -Koa middleware that validates JSON Web Tokens and sets `ctx.state.user` |
25 | | -(by default) if a valid token is provided. |
26 | | - |
27 | | -If you are using koa v1.x, please use the [master](https://github.com/koajs/jwt) branch and version 1.x of this project on npm. |
28 | | -If you are using koa v2, use the [koa-v2](https://github.com/koajs/jwt/tree/koa-v2) branch and version 2.x of this project on npm. |
| 21 | +[license-url]: https://github.com/koajs/jwt/blob/master/LICENSE |
29 | 22 |
|
30 | 23 | This module lets you authenticate HTTP requests using JSON Web Tokens |
31 | 24 | in your [Koa](http://koajs.com/) (node.js) applications. |
32 | 25 |
|
33 | 26 | See [this article](http://blog.auth0.com/2014/01/07/angularjs-authentication-with-cookies-vs-token/) |
34 | 27 | for a good introduction. |
35 | 28 |
|
| 29 | + * If you are using `koa` version 2+, and you have a version of node < 7.6, install `koa-jwt@2`. |
| 30 | + * `koa-jwt` version 3+ on the [master](https://github.com/koajs/jwt) branch uses `async` / `await` and hence requires node >= 7.6.<br> |
| 31 | + * If you are using `koa` version 1, you need to install `koa-jwt@1` from npm. This is the code on the [koa-v1](https://github.com/koajs/jwt/tree/koa-v1) branch. |
| 32 | + |
36 | 33 |
|
37 | 34 | ## Install |
38 | 35 |
|
|
0 commit comments