README
Install
npm install swagger-magic-token-interface --save
swagger-magic-token-interface
token interface for the swagger-magic module
Example
var token = require("swagger-magic-token-interface");
Members
token~generate
generates the token
Params
- user
Object
- the user that his fields can be added as attributes to the token - (Function(err,token)) - done - the callback to call when result ready
Scope: inner member of swagger-magic-token-interface
Example
token.generate(user, done)
token~verify
verifies the validity of the token
Params
- token
String
- the token to be verified - (Function(err,token)) - done - the callback to call when result ready
Scope: inner member of swagger-magic-token-interface
Example
token.verify(token, done)
token~invalidate
invalidates the token
Params
- token
String
- the token to invalidate - (Function(err,boolean)) - done - the callback to call when result ready
Scope: inner member of swagger-magic-token-interface
Example
token.invalidate(token, done)