Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Commit

Permalink
Redirect to Dashboard if user is logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
aqandrew committed Apr 11, 2017
1 parent 101e280 commit 4489ba8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app.js
Expand Up @@ -47,6 +47,17 @@ const cas = new CASAuthentication({
},
cas_version: '2.0'
});

app.get('/', function(req, res, next) {
if (req.session && req.session.cas_user) {
res.redirect('/dashboard');
}

else {
next();
}
});

app.use(express.static('web'));
app.use(bodyParser.json())
app.use('/scripts', express.static('node_modules'));
Expand Down

0 comments on commit 4489ba8

Please sign in to comment.