@salsita/koa-jwt-auth
v1.0.3
Published
[![NPM version](https://img.shields.io/npm/v/@salsita/koa-jwt-auth.svg)](https://www.npmjs.com/package/@salsita/koa-jwt-auth) ![Downloads](https://img.shields.io/npm/dm/@salsita/koa-jwt-auth.svg?style=flat) ![Licence](https://img.shields.io/npm/l/@salsita
Downloads
8
Readme
@salsita/koa-jwt-auth
Configures authentication middleware.
Important options:
key
- secure key for hashing payload (if persistent key not provided, new key is generated with each server start - logging out all users)version
- should be increased with every change increateSession
function, so users using old structure are logged outcreateSession
- function returning data which identifies user (usually user id)getUserForSession
- function which checks if user exists/session is valid (data returned fromcreateSession
are supplied) and result is put intoctx.state.user