fix: accounts: when logout go back to last page
This commit is contained in:
parent
d59a3dc646
commit
9128c0bf38
@ -115,11 +115,9 @@ const router = async(uri) => {
|
||||
|
||||
const view = new match.route.view(getParams(match), lastPageUrlBeforeLogin);
|
||||
|
||||
if (await client.isAuthenticated() === false && !(view instanceof AuthenticationView))
|
||||
if (!(view instanceof AuthenticationView) && ! (view instanceof LogoutView))
|
||||
lastPageUrlBeforeLogin = uri;
|
||||
|
||||
console.log(lastPageUrlBeforeLogin)
|
||||
|
||||
if (view instanceof AbstractRedirectView && await view.redirect())
|
||||
return 1;
|
||||
|
||||
|
@ -2,8 +2,8 @@ import { client, navigateTo } from "../../index.js";
|
||||
import AbstractRedirectView from "./AbstractRedirectView.js";
|
||||
|
||||
export default class extends AbstractRedirectView{
|
||||
constructor(params, title) {
|
||||
super(params, title, "/login");
|
||||
constructor(params, title, uri = "/home") {
|
||||
super(params, title, uri);
|
||||
}
|
||||
|
||||
async redirect()
|
||||
|
@ -2,8 +2,8 @@ import { client, navigateTo } from "../../index.js";
|
||||
import AbstractRedirectView from "./AbstractRedirectView.js";
|
||||
|
||||
export default class extends AbstractRedirectView{
|
||||
constructor(params, title, url) {
|
||||
super(params, title, url);
|
||||
constructor(params, title, uri = "/home") {
|
||||
super(params, title, uri);
|
||||
}
|
||||
|
||||
async redirect()
|
||||
|
@ -2,14 +2,14 @@ import { navigateTo } from "../../index.js";
|
||||
import AbstractView from "./AbstractView.js";
|
||||
|
||||
export default class extends AbstractView{
|
||||
constructor(params, title, url)
|
||||
constructor(params, title, uri)
|
||||
{
|
||||
super(params, title);
|
||||
this.redirect_url = url;
|
||||
this.redirect_url = uri;
|
||||
}
|
||||
|
||||
async redirect()
|
||||
{
|
||||
navigateTo(url);
|
||||
navigateTo(this.redirect_url);
|
||||
}
|
||||
}
|
||||
|
@ -7,9 +7,7 @@ export default class extends AbstractNonAuthenticatedView
|
||||
{
|
||||
constructor(params, lastUrlBeforeLogin = '/home')
|
||||
{
|
||||
|
||||
super(params, lang.get('loginWindowTitle', 'Login'), lastUrlBeforeLogin);
|
||||
this.redirect_url = lastUrlBeforeLogin;
|
||||
this.current_mode = undefined
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@ import AbstractAuthenticatedView from "../abstracts/AbstractAuthenticatedView.js
|
||||
export default class extends AbstractAuthenticatedView
|
||||
{
|
||||
constructor(params, lastPageUrl = '/login') {
|
||||
super(params, lang.get('logoutWindowTitle', 'Logout'));
|
||||
super(params, lang.get('logoutWindowTitle', 'Logout'), lastPageUrl);
|
||||
this.lastPageUrl = lastPageUrl;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user