mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
dont call session expired screen when already in the login page
This commit is contained in:
@@ -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);
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user