RED-7756 - Missing redirect to login page when trying to access tenant without being logged-in
This commit is contained in:
parent
99701c7cd2
commit
ebac60b314
@ -43,9 +43,11 @@ export function ifLoggedIn(): AsyncGuard {
|
||||
await licenseService.loadLicenses();
|
||||
|
||||
const token = await keycloakService.getToken();
|
||||
const jwtToken = jwt_decode(token) as JwtToken;
|
||||
const authTime = (jwtToken.auth_time || jwtToken.iat).toString();
|
||||
localStorage.setItem('authTime', authTime);
|
||||
if (token) {
|
||||
const jwtToken = jwt_decode(token) as JwtToken;
|
||||
const authTime = (jwtToken.auth_time || jwtToken.iat).toString();
|
||||
localStorage.setItem('authTime', authTime);
|
||||
}
|
||||
}
|
||||
|
||||
const isLoggedIn = await keycloakService.isLoggedIn();
|
||||
|
||||
@ -28,11 +28,11 @@ export class RouterHistoryService {
|
||||
}
|
||||
});
|
||||
const ref = effect(async () => {
|
||||
if (this._tenantsService.activeTenantId.length === 0) {
|
||||
const token = await this._keycloakService.getToken();
|
||||
if (this._tenantsService.activeTenantId.length === 0 || !token) {
|
||||
return;
|
||||
}
|
||||
|
||||
const token = await this._keycloakService.getToken();
|
||||
const jwtToken = jwt_decode(token) as JwtToken;
|
||||
const authTime = (jwtToken.auth_time || jwtToken.iat).toString();
|
||||
const localStorageAuthTime = localStorage.getItem('authTime');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user