diff --git a/frontend/static/js/index.js b/frontend/static/js/index.js index c12354a..b09b445 100644 --- a/frontend/static/js/index.js +++ b/frontend/static/js/index.js @@ -113,12 +113,13 @@ 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 (await client.isAuthenticated() === false && !(view instanceof AuthenticationView)) + lastPageUrlBeforeLogin = uri; + + console.log(lastPageUrlBeforeLogin) + if (view instanceof AbstractRedirectView && await view.redirect()) return 1; diff --git a/frontend/static/js/views/accounts/AuthenticationView.js b/frontend/static/js/views/accounts/AuthenticationView.js index 61b0fce..8b4737f 100644 --- a/frontend/static/js/views/accounts/AuthenticationView.js +++ b/frontend/static/js/views/accounts/AuthenticationView.js @@ -7,8 +7,9 @@ export default class extends AbstractNonAuthenticatedView { constructor(params, lastUrlBeforeLogin = '/home') { + super(params, lang.get('loginWindowTitle', 'Login'), lastUrlBeforeLogin); - this.redirectTo = lastUrlBeforeLogin; + this.redirect_url = lastUrlBeforeLogin; this.current_mode = undefined } @@ -132,7 +133,7 @@ export default class extends AbstractNonAuthenticatedView if (response.status === 200 || response.status === 201) { - navigateTo(this.redirectTo); + navigateTo(this.redirect_url); return; }