File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
src/main/webapp/app/blocks/interceptor Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,10 @@ export class ErrorHandlerInterceptor implements HttpInterceptor {
2222 tap (
2323 ( ) => { } ,
2424 ( err : HttpErrorResponse ) => {
25- if ( err . status === 401 ) {
26- this . injector . get ( AuthService ) . resetAuthentication (
27- // no redirect needed when just checking whether authentication is present.
28- request . url !== 'api/account'
29- ) ;
25+ if ( err . status === 401 && request . url === 'api/account' ) {
26+ // If the account endpoint says 401, the user is no longer authenticated:
27+ // clear authentication and redirect to login/access denied.
28+ this . injector . get ( AuthService ) . resetAuthentication ( true ) ;
3029 return ;
3130 }
3231 if ( err . status === 409 && request . method === 'DELETE' ) {
You can’t perform that action at this time.
0 commit comments