From feaaaec128c01b9578d4813ffec0418fc9a128b0 Mon Sep 17 00:00:00 2001 From: AdrienLSH Date: Mon, 29 Jan 2024 10:16:06 +0100 Subject: [PATCH] improved login redirections --- frontend/static/js/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/static/js/index.js b/frontend/static/js/index.js index 2d2af71..4005051 100644 --- a/frontend/static/js/index.js +++ b/frontend/static/js/index.js @@ -107,14 +107,16 @@ const router = async(uri) => { if (lastView !== undefined) await lastView.leavePage(); + if (uri !== '/login' && uri !== '/register' && uri !== '/logout') + lastPageUrlBeforeLogin = uri; + else + lastPageUrlBeforeLogin = undefined; const view = new match.route.view(getParams(match), lastPageUrlBeforeLogin); if (view instanceof AbstractRedirectView && await view.redirect()) return 1; lastView = view; - if (uri !== '/login' && uri !== '/register' && uri !== '/logout') - lastPageUrlBeforeLogin = uri; if (await renderView(view)) return 1;