Skip to content

Commit

Permalink
Fix session detection for "/" endpoint
Browse files Browse the repository at this point in the history
Users who have not signed in are now properly redirected to the login
page.
  • Loading branch information
psvenk committed Apr 21, 2020
1 parent ccaf426 commit faed11d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ app.post('/pdf', async (req, res) => {
});

app.get('/', async (req, res) => {
if(typeof(req.session) != "undefined") {
if (req.session.username) {
res.redirect('/home.html');
} else {
res.redirect('/login.html');
Expand Down

0 comments on commit faed11d

Please sign in to comment.