diff options
Diffstat (limited to 'src/auth.js')
-rw-r--r-- | src/auth.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/auth.js b/src/auth.js index 78e3dea..f040a08 100644 --- a/src/auth.js +++ b/src/auth.js | |||
@@ -27,7 +27,9 @@ function authenticateToken(req, res, next) { | |||
27 | 27 | ||
28 | function authenticateAdmin(req, res, next) { | 28 | function authenticateAdmin(req, res, next) { |
29 | if (!req.cookies || !req.cookies.auth_token) { | 29 | if (!req.cookies || !req.cookies.auth_token) { |
30 | return res.redirect("/login"); | 30 | return res.redirect( |
31 | `/login?redirect=${encodeURIComponent(req.originalUrl)}`, | ||
32 | ); | ||
31 | } | 33 | } |
32 | 34 | ||
33 | const token = req.cookies.auth_token; | 35 | const token = req.cookies.auth_token; |