qwebs-auth-jwt
Authentication service using JSON Web Token for Qwebs server.
Features
Add the jwt secret key in config.json
Declare and inject $auth
const Qwebs = ;const qwebs = ; qwebs;
Use $auth to connect user
{ this$auth = $auth; }; { let payload = login: requestbodylogin ; return this$auth; };; exports = moduleexports = MyService; //Return a class. Qwebs will create it;
Use $auth to authenticate user
{ this$auth = $auth; }; { return self$auth; };; exports = moduleexports = MyService; //Return a class. Qwebs will vreate it;
API
- encode(payload)
- identify(request, response)
- decode(token)
Installation
$ npm install qwebs-auth-jwt