physio-authentication
General authentication module for all Physio services
Instalation
# Include the library
var Auth = require('physio-authentication')
# Init the module
var auth = new Auth({
env: config.get('NODE_ENV'),
baseUrl: 'localhost:3002',
failUrl: 'http://localhost:3002/login',
successUrl: 'http://localhost:3002/'
})
# Use as a expressjs middleware
auth.expressify(app, express);
Usage
router.get('/some/path', function (req, res, next) {
// useage
console.log(req.currentUser);
})