0.0.4 • Published 7 years ago
circe-jwt v0.0.4
circe-jwt JWT处理
安装
使用
import * as Koa from 'koa'
import * as JWT from 'circe-jwt'
import jwt from 'circe-jwt'
const app = new Koa()
app.use(
jwt({secret: 'JSON_WEB_TOKEN_SECRET'})
.unless({paths: [/^\/public/]})
)
app.use((async (ctx) => {
// ctx.state.user
// JWT.sign()
// JWT.verify()
// JWT.decode()
}))
参数
- secret: string
- key?: string