egg-jwt icon indicating copy to clipboard operation
egg-jwt copied to clipboard

JWT authentication plugin for egg

Results 15 egg-jwt issues
Sort by recently updated
recently updated
newest added

decode 返回应该和payload 一致

``` const jwt: { sign(payload: string | object | Buffer, secretOrPrivateKey: string, options?: any, callback?: any): string; verify(token: string, secretOrPrivateKey: string, options?: any, callback?: any): string; decode(token: string): string; }...

```javascript // config/config.default.js jwt: { secret: 'Great4-M', enable: true, ignore: '/api/user/access/login', } ``` ```javascript // app/router.js const { router, controller, middleware } = app; const jwt = middleware.jwt(app.config.jwt); router.get('/api/user', jwt,...

ctx.state.user 可以提取到JWT编码的data,这里的原理是什么?

401返回内容能否自定义,现在默认返回的,不是很友好,怎么修改成返回自定义的内容

建议在readme里加入verify的用法,这样对新手用户更友好。

Maybe need a `mockJwt` funciton

从代码看最新版的index.d.ts上看补全了eggConfig的定义,但是options定义的不够全导致: ![image](https://user-images.githubusercontent.com/23078182/52162422-cfbff500-270e-11e9-9e2a-80324ec9c614.png) 暂时typescript只能这样使用: ![image](https://user-images.githubusercontent.com/23078182/52162434-ee25f080-270e-11e9-9330-5abc83bdbddb.png) yarn.lock: ![image](https://user-images.githubusercontent.com/23078182/52162454-2299ac80-270f-11e9-91da-098f0f5efd53.png)