From ac19cc7f06be2783d37610d4ff8274aac6e97561 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Fri, 23 Feb 2024 12:15:16 -0300 Subject: [PATCH 1/2] clear session for non authenticated --- .../webapp/app/core/interceptor/auth-expired.interceptor.ts.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/angular/templates/src/main/webapp/app/core/interceptor/auth-expired.interceptor.ts.ejs b/generators/angular/templates/src/main/webapp/app/core/interceptor/auth-expired.interceptor.ts.ejs index 665679cb1722..2172ec3ecf09 100644 --- a/generators/angular/templates/src/main/webapp/app/core/interceptor/auth-expired.interceptor.ts.ejs +++ b/generators/angular/templates/src/main/webapp/app/core/interceptor/auth-expired.interceptor.ts.ejs @@ -37,7 +37,7 @@ export class AuthExpiredInterceptor implements HttpInterceptor { return next.handle(request).pipe( tap({ error: (err: HttpErrorResponse) => { - if (err.status === 401 && err.url && !err.url.includes('api/account') && this.accountService.isAuthenticated()) { + if (err.status === 401 && err.url && !err.url.includes('api/account')) { <%_ if (authenticationTypeSession) { _%> if (err.url.includes(this.loginService.logoutUrl())) { this.loginService.logoutInClient(); From 880d2f6a77d36b1bb4e64decf87d9590f646ec49 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Mon, 26 Feb 2024 08:04:27 -0300 Subject: [PATCH 2/2] remove unused property --- .../webapp/app/core/interceptor/auth-expired.interceptor.ts.ejs | 2 -- 1 file changed, 2 deletions(-) diff --git a/generators/angular/templates/src/main/webapp/app/core/interceptor/auth-expired.interceptor.ts.ejs b/generators/angular/templates/src/main/webapp/app/core/interceptor/auth-expired.interceptor.ts.ejs index 2172ec3ecf09..9b6aa7d122a7 100644 --- a/generators/angular/templates/src/main/webapp/app/core/interceptor/auth-expired.interceptor.ts.ejs +++ b/generators/angular/templates/src/main/webapp/app/core/interceptor/auth-expired.interceptor.ts.ejs @@ -24,14 +24,12 @@ import { Router } from '@angular/router'; import { LoginService } from 'app/login/login.service'; import { StateStorageService } from 'app/core/auth/state-storage.service'; -import { AccountService } from 'app/core/auth/account.service'; @Injectable() export class AuthExpiredInterceptor implements HttpInterceptor { private loginService = inject(LoginService); private stateStorageService = inject(StateStorageService); private router = inject(Router); - private accountService = inject(AccountService); intercept(request: HttpRequest, next: HttpHandler): Observable> { return next.handle(request).pipe(