accounts: fix: redirect to last page before login work again

This commit is contained in:
starnakin 2024-02-13 15:38:57 +01:00 committed by AdrienLSH
parent ca85e59488
commit 459cf11533
2 changed files with 8 additions and 6 deletions

View File

@ -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;

View File

@ -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;
}