Skip to content

Commit

Permalink
Redirect to 'test' view (error handling)
Browse files Browse the repository at this point in the history
  • Loading branch information
Silfer committed Mar 22, 2017
1 parent 98eeeb0 commit e45d6de
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ app.use(function (req, res, next) {
console.log('404');
//res.status(404);
//res.send(err.message || '** no unicorns here **');
res.redirect('/login');
res.redirect('/test');
//res.render('error.html');
});

Expand Down
16 changes: 2 additions & 14 deletions source/controller/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,11 @@
*/
var get = function (req, res, next)
{

var user;
var auth = req.body.auth;
var user;
if (auth.success) {
user = auth.decoded;
} else {
console.log('auth failed');
}
res.render
(
'index',
'test',
{
title: 'E-Tutorial - Login',
user: user,
ip: req.app.get('server-ip'),
port: req.app.get('server-port')
title: 'Error Page'
}
);
}
Expand Down
2 changes: 2 additions & 0 deletions source/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var index = require ('./controller/index');
var lobby = require ('./controller/lobby');
var login = require ('./controller/login');
var dashboard = require('./controller/dashboard');
var test = require('./controller/test');

router.get ('/lobby/:userId/:moduleId/:tutorialId', auth.ensureAuth, lobby.get);

Expand All @@ -18,6 +19,7 @@ router.get ('/login', auth.ensureAuth, login.get);
router.get ('/login/callback', login.callback);

router.get ('/dashboard', auth.ensureAuth, dashboard.get);
router.get ('/test', test.get);

router.post('/api/dashboard/forceSyncIVLE', auth.ensureAuth, dashboard.forceSyncIVLE);
router.post('/api/dashboard/getTutorials', auth.ensureAuth, dashboard.getTutorials);
Expand Down
2 changes: 1 addition & 1 deletion source/view/test.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@

<style>
body {
background-color: #E9E9E9;
background-color: #000000;
}
</style>

0 comments on commit e45d6de

Please sign in to comment.