Install
npm install swagger-magic-auth-interface --save
#swagger-magic-auth-interface
auth interface for the swagger-magic module
Example
var auth = require("swagger-magic-auth-interface");
Members
##auth~generateToken
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-auth-interface
Example
auth.generateToken(user, done)
##auth~verifyToken
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-auth-interface
Example
auth.verifyToken(token, done)
##auth~invalidateToken
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-auth-interface
Example
auth.invalidateToken(token, done)