Fix issue when login with wrong credentials. Fixes #1481
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Build / Node 14 (push) Has been cancelled
Build / Node 16 (push) Has been cancelled
Build / Node 18 (push) Has been cancelled

This commit is contained in:
grossmj 2025-03-15 14:58:54 +07:00
parent 8222417c91
commit cdf1b0ab72
No known key found for this signature in database
GPG Key ID: 1E7DD6DBB53FF3D7
3 changed files with 10 additions and 8 deletions

View File

@ -94,6 +94,7 @@ export class LoginComponent implements OnInit, DoCheck {
} }
}, },
(error) => { (error) => {
this.isRememberMe = false;
this.loginError = true; this.loginError = true;
} }
); );

View File

@ -11,11 +11,12 @@ export class HttpRequestsInterceptor implements HttpInterceptor {
intercept(httpRequest: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { intercept(httpRequest: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
return next.handle(httpRequest).pipe( return next.handle(httpRequest).pipe(
catchError((err) => { catchError((err) => {
if (err.status === 401 || err.status === 403) { return throwError(err);
this.call(); // if (err.status === 401 || err.status === 403) {
} else { // this.call();
return throwError(err); // } else {
} // return throwError(err);
// }
}) })
); );
} }

View File

@ -89,9 +89,9 @@ export class ControllerErrorHandler {
err = ControllerError.fromError('Controller is unreachable', error); err = ControllerError.fromError('Controller is unreachable', error);
} }
if (error.status === 401) { //if (error.status === 401) {
window.location.reload(); // window.location.reload();
} //}
return throwError(err); return throwError(err);
} }