From e0a4d1bb1339e80775aa37efaf8cac314278f8e9 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Mon, 19 Oct 2020 21:55:02 -0500 Subject: Add navigation template and logout --- src/server.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/server.js') diff --git a/src/server.js b/src/server.js index 541f467..17d5372 100644 --- a/src/server.js +++ b/src/server.js @@ -67,6 +67,10 @@ function setUpRoutes(models, jwtFunctions, database, templates) { let body = templates["login"]({}); res.status(200).send(body) }) + server.get('/logout', (req, res) => { + res.clearCookie('authorization'); + res.redirect("/login"); + }); server.get('/login/signup', async (req, res) => { let body = templates["signup"]({}); res.status(200).send(body) -- cgit v1.2.3