Skip to content

Commit

Permalink
Merge pull request jhipster#493 from pascalgrimaud/remove-auto-redire…
Browse files Browse the repository at this point in the history
…ct-on-401

Remove auto redirect on 401 to fix infinite loop with OAuth2
  • Loading branch information
pascalgrimaud authored Jan 16, 2021
2 parents f934908 + 966df7e commit b3fd53f
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ export class AuthExpiredInterceptor implements HttpInterceptor {
tap({
error: (err: HttpErrorResponse) => {
if (err.status === 401 && err.url && !err.url.includes('api/account')) {
// customization to not have infinite loop: remove logout and login open
this.stateStorageService.storeUrl(this.router.routerState.snapshot.url);
this.loginService.logout();
this.router.navigate(['']);
this.loginModalService.open();
}
},
})
Expand Down

0 comments on commit b3fd53f

Please sign in to comment.