users.js 597 Bytes
var express = require('express');
var IoC = require('electrolyte');

exports = module.exports = function (settings, logger) {
  var app = this;
  app.use('/', function (req, res, next) {
    res.render('index', { 'csrfToken': 'xxxx' });
    next();
  });

  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'];