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(() => {
|
||||
if (sessionStorage.getItem('logged') === 'yes') {
|
||||
if (!KeyCloakService.isLoggedIn()) {
|
||||
|
@ -28,7 +28,7 @@ const initKeycloak = (onAuthenticatedCallback) => {
|
||||
const doLogin = () => {
|
||||
const privacyPolicyAccept = localStorage.getItem('privacyPolicy');
|
||||
if (privacyPolicyAccept !== 'accept') {
|
||||
window.location = `${ROOT_URL}${POLICY_PRIVACY_PAGE}/login`;
|
||||
window.location.replace(`${ROOT_URL}${POLICY_PRIVACY_PAGE}/login`);
|
||||
} else {
|
||||
sessionStorage.setItem('logout', '');
|
||||
_kc.login();
|
||||
@ -46,7 +46,7 @@ const getToken = () => _kc.token;
|
||||
const doRegister = () => {
|
||||
const privacyPolicyAccept = localStorage.getItem('privacyPolicy');
|
||||
if (privacyPolicyAccept !== 'accept') {
|
||||
window.location = `${ROOT_URL}${POLICY_PRIVACY_PAGE}/register`;
|
||||
window.location.replace(`${ROOT_URL}${POLICY_PRIVACY_PAGE}/register`);
|
||||
} else {
|
||||
_kc.register();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user