Skip to content

Commit

Permalink
Add /logout
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlgo11 committed May 19, 2024
1 parent d03d503 commit 209922b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions routes/authRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ app.get('/login', async (req, res) => {
res.render('login', {title: 'Log in to continue', backgrounds: req.bg});
});

app.get('/logout', (req, res) => {
req.session.destroy();
return res.redirect('/login');
});

app.get('/register', async (req, res) => {
res.cookie('challenge', crypto.randomUUID(), {
maxAge: 1000 * 60,
Expand Down

0 comments on commit 209922b

Please sign in to comment.