users.js
751 Bytes
var express = require('express');
var IoC = require('electrolyte');
exports = module.exports = function (settings, logger) {
var app = this;
var router = express.Router();
router.get('/', function (req, res, next) {
res.render('index', { 'csrfToken': 'xxxx' });
});
router.get('/login', function (req, res, next) {
res.render('index', { 'csrfToken': 'xxxx' });
});
app.use('/', router);
app.use(settings.proxy.signOutUrl, function (req, res, next) {
req.session.token = null;
req.session.save(function (err) {
if (err)
logger.error(err);
else
res.redirect(settings.proxy.signInUrl);
});
});
};
exports['@singleton'] = true;
exports['@require'] = ['igloo/settings', 'igloo/logger'];