diff --git a/src/app/core/interceptors/error.interceptor.ts b/src/app/core/interceptors/error.interceptor.ts index 7808d8761..ff65b89ba 100644 --- a/src/app/core/interceptors/error.interceptor.ts +++ b/src/app/core/interceptors/error.interceptor.ts @@ -16,7 +16,7 @@ export class ErrorInterceptor implements HttpInterceptor { return next.handle(request).pipe( catchError((err) => { if (err.status === 401) { - this.authService.logout() + this.authService.login(window.location.href) } if (err.status === 403) { this.profileService.setUnapproveUser(true) diff --git a/src/app/core/interceptors/oauth.interceptor.ts b/src/app/core/interceptors/oauth.interceptor.ts index 5830634d0..1842c8413 100644 --- a/src/app/core/interceptors/oauth.interceptor.ts +++ b/src/app/core/interceptors/oauth.interceptor.ts @@ -35,7 +35,7 @@ export class OAuthInterceptor implements HttpInterceptor { private handleError(error: HttpErrorResponse): Observable { if (error.status === 401) { - this.oauthService.logOut() + this.oauthService.initCodeFlow(window.location.href) } else if (error.status === 409 && error.url.includes('/admin/user/')) { return of() }