correct privacy policy mount and env
This commit is contained in:
parent
a5841eb830
commit
1863373456
2
.env
2
.env
@ -1,3 +1,3 @@
|
|||||||
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-localhost
|
REACT_APP_KC_CLIENT_ID=gonito-dev-heroku
|
||||||
|
@ -25,14 +25,7 @@ const initKeycloak = (onAuthenticatedCallback) => {
|
|||||||
.catch(console.error);
|
.catch(console.error);
|
||||||
};
|
};
|
||||||
|
|
||||||
const doLogin = () => {
|
const doLogin = _kc.login;
|
||||||
const privacyPolicyAccept = localStorage.getItem('privacyPolicy');
|
|
||||||
if (privacyPolicyAccept !== 'accept') {
|
|
||||||
window.location.replace(`${ROOT_URL}${POLICY_PRIVACY_PAGE}`);
|
|
||||||
} else {
|
|
||||||
_kc.login();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const doLogout = () => {
|
const doLogout = () => {
|
||||||
sessionStorage.clear();
|
sessionStorage.clear();
|
||||||
@ -41,7 +34,14 @@ const doLogout = () => {
|
|||||||
|
|
||||||
const getToken = () => _kc.token;
|
const getToken = () => _kc.token;
|
||||||
|
|
||||||
const doRegister = _kc.register;
|
const doRegister = () => {
|
||||||
|
const privacyPolicyAccept = localStorage.getItem('privacyPolicy');
|
||||||
|
if (privacyPolicyAccept !== 'accept') {
|
||||||
|
window.location.replace(`${ROOT_URL}${POLICY_PRIVACY_PAGE}`);
|
||||||
|
} else {
|
||||||
|
_kc.register();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const isLoggedIn = () => !!_kc.token;
|
const isLoggedIn = () => !!_kc.token;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user