auth-jwt
An authentication module using JWT
Install
npm install auth-jwt
Usage
Example
auth.js
const auth = ; let { auth } app
routes.js
app
Include the JWT or Bearer in requests
Include the token created by JWT in the request header
Authorization: JWT JSON_WEB_TOKEN_STRING.....
or
Authorization: Bearer JSON_WEB_TOKEN_STRING.....
Get token in requests
const auth = ; let { auth }
Async / Await
const auth = ; moduleexports = async { try requser = await auth; ; catch resstatus401; }
Tests
npm install
npm test
License
The MIT License
Copyright (c) 2016 Wallace Silva