Improve some login/logout handling

This commit is contained in:
the-djmaze 2022-10-18 23:32:47 +02:00
parent b77854e421
commit 93d8b5a419
4 changed files with 11 additions and 16 deletions

View file

@ -17,14 +17,16 @@ export class AbstractApp {
this.Remote = Remote;
}
logoutReload() {
const url = logoutLink();
logoutReload(url) {
url = url || logoutLink();
if (location.href !== url) {
setTimeout(() => location.href = url, 100);
} else {
rl.route.reload();
}
// this does not work due to ViewModelClass.__builded = true;
// rl.settings.set('Auth', false);
// rl.app.start();
}
bootstart() {

View file

@ -200,14 +200,7 @@ export class AppUser extends AbstractApp {
}
logout() {
Remote.request('Logout', () => {
const customLogoutLink = Settings.app('customLogoutLink');
if (customLogoutLink) {
location.href = customLogoutLink;
} else {
rl.logoutReload()
}
});
Remote.request('Logout', () => rl.logoutReload(Settings.app('customLogoutLink')));
}
bootstart() {