redirect to challenges page when logged after accepting policy privacy
This commit is contained in:
parent
d88bb1d0ea
commit
45601ce05c
@ -44,6 +44,14 @@ const App = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
sessionStorage.getItem('logged') === 'yes' &&
|
||||||
|
(window.location.pathname === `${POLICY_PRIVACY_PAGE}/login` ||
|
||||||
|
window.location.pathname === `${POLICY_PRIVACY_PAGE}/register`)
|
||||||
|
) {
|
||||||
|
window.location.replace(`${ROOT_URL}/challenges`);
|
||||||
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (sessionStorage.getItem('logged') === 'yes') {
|
if (sessionStorage.getItem('logged') === 'yes') {
|
||||||
if (!KeyCloakService.isLoggedIn()) {
|
if (!KeyCloakService.isLoggedIn()) {
|
||||||
|
@ -28,7 +28,7 @@ const initKeycloak = (onAuthenticatedCallback) => {
|
|||||||
const doLogin = () => {
|
const doLogin = () => {
|
||||||
const privacyPolicyAccept = localStorage.getItem('privacyPolicy');
|
const privacyPolicyAccept = localStorage.getItem('privacyPolicy');
|
||||||
if (privacyPolicyAccept !== 'accept') {
|
if (privacyPolicyAccept !== 'accept') {
|
||||||
window.location = `${ROOT_URL}${POLICY_PRIVACY_PAGE}/login`;
|
window.location.replace(`${ROOT_URL}${POLICY_PRIVACY_PAGE}/login`);
|
||||||
} else {
|
} else {
|
||||||
sessionStorage.setItem('logout', '');
|
sessionStorage.setItem('logout', '');
|
||||||
_kc.login();
|
_kc.login();
|
||||||
@ -46,7 +46,7 @@ const getToken = () => _kc.token;
|
|||||||
const doRegister = () => {
|
const doRegister = () => {
|
||||||
const privacyPolicyAccept = localStorage.getItem('privacyPolicy');
|
const privacyPolicyAccept = localStorage.getItem('privacyPolicy');
|
||||||
if (privacyPolicyAccept !== 'accept') {
|
if (privacyPolicyAccept !== 'accept') {
|
||||||
window.location = `${ROOT_URL}${POLICY_PRIVACY_PAGE}/register`;
|
window.location.replace(`${ROOT_URL}${POLICY_PRIVACY_PAGE}/register`);
|
||||||
} else {
|
} else {
|
||||||
_kc.register();
|
_kc.register();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user