dont call session expired screen when already in the login page

This commit is contained in:
2026-04-07 15:21:30 +01:00
parent e147164f07
commit 5fb8b67599
@@ -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);
})
);