@salsita/koa-jwt-auth

1.0.3 • Public • Published

@salsita/koa-jwt-auth

NPM version Downloads Licence Dependency Status devDependency Status

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 in createSession function, so users using old structure are logged out
  • createSession - function returning data which identifies user (usually user id)
  • getUserForSession - function which checks if user exists/session is valid (data returned from createSession are supplied) and result is put into ctx.state.user

/@salsita/koa-jwt-auth/

    Package Sidebar

    Install

    npm i @salsita/koa-jwt-auth

    Weekly Downloads

    0

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    3.63 kB

    Total Files

    3

    Last publish

    Collaborators