cupcoffee-auth-jwt
JWT authentication to CupcoffeeJs
Install
Create environment variable: NODE_CUPCOFFEE_JWT_SECRET or NODE_JWT_SECRET with secret code to JWT.
Example:
NODE_CUPCOFFEE_JWT_SECRET=MY.SCRET.CODE.TO.JWT
Or manually add to require('cupcoffee-auth-jwt')('MY.SCRET.CODE.TO.JWT')
Middware
middware/index.js
var cupJwt = module { this { return cupJwt } return this; }
Routes
routes/index.js
var cupJwt = module { router; router return router;};
Token
In the HTML header to send x-access-token
with the token and x-key
with the username;