chentsulin / koa-bearer-token

Bearer token parser middleware for koa
MIT License
33 stars 6 forks source link

feat: support access_token in signed or non-signed cookie #6

Closed chentsulin closed 3 years ago

chentsulin commented 3 years ago

Get token from cookie key (it can be signed or not)

app.use(
  bearerToken({
    cookie: {
      signed: true, // if passed true you must pass secret otherwise will throw error
      secret: 'YOUR_APP_SECRET',
      key: 'access_token', // default value
    },
  }),
);