Skip to content

Commit

Permalink
Redirect to the login page instead of the logout page, when the user …
Browse files Browse the repository at this point in the history
…is already logged out
  • Loading branch information
askask committed Jun 11, 2024
1 parent e54a3d7 commit fa0721d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/core/interceptors/error.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/interceptors/oauth.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class OAuthInterceptor implements HttpInterceptor {

private handleError(error: HttpErrorResponse): Observable<never> {
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()
}
Expand Down

0 comments on commit fa0721d

Please sign in to comment.