diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/email-settings.js | 13 | ||||
-rw-r--r-- | config/express.js | 4 | ||||
-rw-r--r-- | config/middlewares/authorization.js | 13 |
3 files changed, 15 insertions, 15 deletions
diff --git a/config/email-settings.js b/config/email-settings.js deleted file mode 100644 index 8bc9983..0000000 --- a/config/email-settings.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Email settings - */ - -module.exports = { - - host: 'localhost', - user: 'divid', - password: '', - sender: 'Divid <divid@divid.no>' - -} - diff --git a/config/express.js b/config/express.js index 4afd827..eb10b20 100644 --- a/config/express.js +++ b/config/express.js @@ -48,11 +48,11 @@ module.exports = function (app, config, passport) { console.error(err.stack); - res.status(500).render('500', { error: err.stack }); // render page + res.status(500).render('error', { title: '500', text: 'En serverfeil oppstod', error: err.stack }); // render page }); app.use(function(req, res, next) { - res.status(404).render('404', { url: req.originalUrl, error: 'Not found' }); // render page + res.status(404).render('error', { title: '404', text: 'Fant ikke siden du så etter' }); // render page }); }); } diff --git a/config/middlewares/authorization.js b/config/middlewares/authorization.js new file mode 100644 index 0000000..440f085 --- /dev/null +++ b/config/middlewares/authorization.js @@ -0,0 +1,13 @@ + + +/* + * Generic require login routing + */ + +exports.requiresLogin = function(req, res, next) { + if (!req.isAuthenticated()) return res.redirect('/login'); + next(); +} + + + |