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) console.log("refresh token error",error)
SessionStore.setInativity(false) SessionStore.setInativity(false)
const sessionExpiredMessage = if(window.location.pathname.includes('/home/')) {
'A sua sessão expirou. Por favor, faça login novamente para continuar.';
const goToAuth = () => { const sessionExpiredMessage =
if (environment.production) { 'A sua sessão expirou. Por favor, faça login novamente para continuar.';
window.location.pathname = '/auth'; const goToAuth = () => {
} else if (!this.router.url.startsWith('/auth')) { if (environment.production) {
this.router.navigateByUrl('/auth', { replaceUrl: true }); 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); console.log('sessionExpiredModal', this.sessionExpiredModal)
this.roomLocalRepository.clear();
void this.sessionExpiredModal.present(sessionExpiredMessage, goToAuth);
}
return of(false); return of(false);
}) })
); );