fix autologin on fail

This commit is contained in:
2025-01-17 10:18:01 +01:00
parent 7e9fd4b623
commit 16d2503d97
4 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "bstlboard",
"version": "2.2.0",
"version": "2.2.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "bstlboard",
"version": "2.2.0",
"version": "2.2.1",
"license": "AGPL3",
"dependencies": {
"@angular/animations": "^17.3.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "bstlboard",
"version": "2.2.0",
"version": "2.2.1",
"license": "AGPL3",
"scripts": {
"ng": "ng",
+1
View File
@@ -78,6 +78,7 @@ export class AuthenticatedGuard implements CanActivate {
return true;
}).catch(function (error) {
if (error instanceof RequestError && (error as RequestError).getResponse().status == 401) {
localStorage.removeItem("bstlboard.autologin");
return that.router.navigateByUrl(that.router.parseUrl('/login?target=' + encodeURIComponent(state.url)), { skipLocationChange: true, replaceUrl: true });
}
+2
View File
@@ -38,10 +38,12 @@ export class PageLogin implements OnInit {
}
if (params['error'] || params['error'] == '') {
this.loginInvalid = true;
localStorage.removeItem("bstlboard.autologin");
this.router.navigate([], { queryParams: { error: null }, queryParamsHandling: 'merge', replaceUrl: true });
}
if (params['externalError'] || params['externalError'] == '') {
this.externalLoginInvalid = true;
localStorage.removeItem("bstlboard.autologin");
this.router.navigate([], { queryParams: { externalError: null }, queryParamsHandling: 'merge', replaceUrl: true });
}
}