diff --git a/ProjectSourceCode/src/index.js b/ProjectSourceCode/src/index.js index e04f54a..c70bd91 100644 --- a/ProjectSourceCode/src/index.js +++ b/ProjectSourceCode/src/index.js @@ -246,17 +246,21 @@ app.get('/home', (req, res) => { const loggedIn = req.session.user ? true : false; res.render('pages/home'); }); + app.get('/logout', (req, res) => { req.session.destroy(err => { if (err) { console.error('Error destroying session:', err); res.status(500).send('Internal Server Error'); } else { - res.render('pages/home', { message: 'Logged out Successfully' }); + // Redirect to the same page after destroying the session + res.redirect('/'); // You can change '/' to the desired page if it's not the home page } }); }); + + /************************ League Page Routes *************************/ diff --git a/ProjectSourceCode/src/resources/js/club-page/refresh-for-favorite.js b/ProjectSourceCode/src/resources/js/club-page/refresh-for-favorite.js deleted file mode 100644 index e69de29..0000000