redirect to privacy policy correction
This commit is contained in:
parent
ddf87f7c74
commit
2bb962b002
2
.env
2
.env
@ -1,5 +1,5 @@
|
|||||||
REACT_APP_KC_URL=https://auth-dev.csi.wmi.amu.edu.pl/
|
REACT_APP_KC_URL=https://auth-dev.csi.wmi.amu.edu.pl/
|
||||||
REACT_APP_KC_REALM=gonito-dev
|
REACT_APP_KC_REALM=gonito-dev
|
||||||
REACT_APP_KC_CLIENT_ID=gonito-dev-heroku
|
REACT_APP_KC_CLIENT_ID=gonito-dev-localhost
|
||||||
|
|
||||||
REACT_APP_API=https://gonito.net/api
|
REACT_APP_API=https://gonito.net/api
|
||||||
|
@ -25,7 +25,14 @@ const initKeycloak = (onAuthenticatedCallback) => {
|
|||||||
.catch(console.error);
|
.catch(console.error);
|
||||||
};
|
};
|
||||||
|
|
||||||
const doLogin = _kc.login;
|
const doLogin = () => {
|
||||||
|
const privacyPolicyAccept = localStorage.getItem('privacyPolicy');
|
||||||
|
if (privacyPolicyAccept !== 'accept') {
|
||||||
|
window.location = `${ROOT_URL}${POLICY_PRIVACY_PAGE}`;
|
||||||
|
} else {
|
||||||
|
_kc.login();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const doLogout = () => {
|
const doLogout = () => {
|
||||||
sessionStorage.clear();
|
sessionStorage.clear();
|
||||||
@ -37,7 +44,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.replace(`${ROOT_URL}${POLICY_PRIVACY_PAGE}`);
|
window.location = `${ROOT_URL}${POLICY_PRIVACY_PAGE}`;
|
||||||
} else {
|
} else {
|
||||||
_kc.register();
|
_kc.register();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user