diff --git a/src/app/infra/monitoring/interceptors/token.interceptors.ts b/src/app/infra/monitoring/interceptors/token.interceptors.ts index 13a62afc7..364dca4ab 100644 --- a/src/app/infra/monitoring/interceptors/token.interceptors.ts +++ b/src/app/infra/monitoring/interceptors/token.interceptors.ts @@ -136,18 +136,21 @@ export class TokenInterceptor implements HttpInterceptor { console.log("refresh token error",error) SessionStore.setInativity(false) - const sessionExpiredMessage = - 'A sua sessão expirou. Por favor, faça login novamente para continuar.'; - const goToAuth = () => { - if (environment.production) { - window.location.pathname = '/auth'; - } else if (!this.router.url.startsWith('/auth')) { - this.router.navigateByUrl('/auth', { replaceUrl: true }); - } - }; - console.log('sessionExpiredModal', this.sessionExpiredModal) - this.roomLocalRepository.clear(); - void this.sessionExpiredModal.present(sessionExpiredMessage, goToAuth); + if(window.location.pathname.includes('/home/')) { + + const sessionExpiredMessage = + 'A sua sessão expirou. Por favor, faça login novamente para continuar.'; + const goToAuth = () => { + if (environment.production) { + window.location.pathname = '/auth'; + } else if (!this.router.url.startsWith('/auth')) { + this.router.navigateByUrl('/auth', { replaceUrl: true }); + } + }; + console.log('sessionExpiredModal', this.sessionExpiredModal) + this.roomLocalRepository.clear(); + void this.sessionExpiredModal.present(sessionExpiredMessage, goToAuth); + } return of(false); }) );