1.0.5 • Published 8 years ago

koa-jwtauth v1.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

koa-jwtauth

JSONWebtoken middleware for koa@2

This middleware watches for the authorization header and sets user data from jwttoken to ctx.state if the header exists.

Middleware can throws the Forbidden error and prevents next middleware execution or silently calls next middleware.

#Usage:

import jwtmiddleware from 'koa-jwtauth'
import {createHash} from 'crypto'

const securityToken = createHash('md5').update('Some salt').digest('hex');

//silent
app.use(jwtmiddleware(securityToken));
//throw 403 error
app.use(jwtmiddleware(securityToken, true));
  
1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago