diff options
author | Dennis Eriksen <dennis.se@gmail.com> | 2013-04-16 14:19:21 +0200 |
---|---|---|
committer | Dennis Eriksen <dennis.se@gmail.com> | 2013-04-16 14:19:21 +0200 |
commit | 7eb42b129702fa3fda67f50913b00cc85e49f116 (patch) | |
tree | 1683dcb24310a21087b3c633d65304b563cf7a05 /router.js | |
parent | Positioning animation (diff) | |
download | Divid-7eb42b129702fa3fda67f50913b00cc85e49f116.tar.gz |
added dashboard
Diffstat (limited to '')
-rw-r--r-- | router.js | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -56,15 +56,20 @@ module.exports = function(app) { } else { console.log('jeg er inne i elsen'); AM.autoLogin(req.cookies.user, req.cookies.pass, function(o) { - req.session.user = o; - console.log('DAFUQ SKJEDDE NĂ…'); - res.render('index', { title: 'Autologin' }); + if (o != null) { + req.session.user = o; + res.redirect('/IJUSTAUTOLOGGEDDEGINN'); + } else { + res.redirect('/'); + } }); - res.redirect('/IJUSTAUTOLOGGEDDEGINN'); } // res.redirect('/HAHAHAHAHAHA'); } else { - res.render('index', { title: 'kanin' }); + res.render('dashboard', { + title: 'kanin', + loggedin: true + }); } }); |