fix autologin on fail
This commit is contained in:
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "bstlboard",
|
"name": "bstlboard",
|
||||||
"version": "2.2.0",
|
"version": "2.2.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "bstlboard",
|
"name": "bstlboard",
|
||||||
"version": "2.2.0",
|
"version": "2.2.1",
|
||||||
"license": "AGPL3",
|
"license": "AGPL3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^17.3.1",
|
"@angular/animations": "^17.3.1",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bstlboard",
|
"name": "bstlboard",
|
||||||
"version": "2.2.0",
|
"version": "2.2.1",
|
||||||
"license": "AGPL3",
|
"license": "AGPL3",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ export class AuthenticatedGuard implements CanActivate {
|
|||||||
return true;
|
return true;
|
||||||
}).catch(function (error) {
|
}).catch(function (error) {
|
||||||
if (error instanceof RequestError && (error as RequestError).getResponse().status == 401) {
|
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 });
|
return that.router.navigateByUrl(that.router.parseUrl('/login?target=' + encodeURIComponent(state.url)), { skipLocationChange: true, replaceUrl: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,10 +38,12 @@ export class PageLogin implements OnInit {
|
|||||||
}
|
}
|
||||||
if (params['error'] || params['error'] == '') {
|
if (params['error'] || params['error'] == '') {
|
||||||
this.loginInvalid = true;
|
this.loginInvalid = true;
|
||||||
|
localStorage.removeItem("bstlboard.autologin");
|
||||||
this.router.navigate([], { queryParams: { error: null }, queryParamsHandling: 'merge', replaceUrl: true });
|
this.router.navigate([], { queryParams: { error: null }, queryParamsHandling: 'merge', replaceUrl: true });
|
||||||
}
|
}
|
||||||
if (params['externalError'] || params['externalError'] == '') {
|
if (params['externalError'] || params['externalError'] == '') {
|
||||||
this.externalLoginInvalid = true;
|
this.externalLoginInvalid = true;
|
||||||
|
localStorage.removeItem("bstlboard.autologin");
|
||||||
this.router.navigate([], { queryParams: { externalError: null }, queryParamsHandling: 'merge', replaceUrl: true });
|
this.router.navigate([], { queryParams: { externalError: null }, queryParamsHandling: 'merge', replaceUrl: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user