diff --git a/src/components/ButtonHilight.js b/src/components/ButtonHilight.js index 1d537c6..79d8017 100644 --- a/src/components/ButtonHilight.js +++ b/src/components/ButtonHilight.js @@ -192,8 +192,12 @@ const ButtonHilight = () => { //alert(" deccc"); //console.log(" ### AVANNN deconnexion iciiii"); if (typeof (stored_part) != "undefined") { - console.log(" ### deconnexion iciiii"); + const stored_cookie = getCookie('tokenmysypart'); + var acces_right_token_name = stored_cookie+"_uar"; + setpartCookie("tokenmysypart", "", { path: '/' }); + setpartCookie(acces_right_token_name, "", { path: '/' }); + removeCookie(acces_right_token_name, { path: '/' }); } history.push("/recherche-formation"); } @@ -201,7 +205,7 @@ const ButtonHilight = () => { function part_logout() { confirmAlert({ title: '', - message: 'Confirmez la deconnexion (pro)', + message: 'Confirmez la deconnexion (pro bb)', buttons: [ { label: 'Oui', diff --git a/src/components/Header.js b/src/components/Header.js index 34852d1..f0c6f26 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -139,7 +139,14 @@ const Header = () => { /* si c'est une connexion partner qui est active */ if (typeof (stored_part) != "undefined") { + const stored_cookie = getCookie('tokenmysypart'); + var acces_right_token_name = stored_cookie+"_uar"; + setpartCookie("tokenmysypart", "", { path: '/' }); + setpartCookie(acces_right_token_name, "", { path: '/' }); + removeCookie(acces_right_token_name, { path: '/' }); + + } history.push("/recherche-formation"); } @@ -147,7 +154,7 @@ const Header = () => { function part_logout() { confirmAlert({ title: '', - message: 'Confirmez la deconnexion (pro)', + message: 'Confirmez la deconnexion (pro aa )', buttons: [ { label: 'Oui', diff --git a/src/components/ListeArticles.js b/src/components/ListeArticles.js index 9cbc8ae..6566b36 100644 --- a/src/components/ListeArticles.js +++ b/src/components/ListeArticles.js @@ -379,7 +379,12 @@ const ListeArticles = (props) => { function part_logout_confirmation() { /* si c'est une connexion partner qui est active */ if (typeof (stored_part) != "undefined") { + const stored_cookie = getCookie('tokenmysypart'); + var acces_right_token_name = stored_cookie+"_uar"; + setpartCookie("tokenmysypart", "", { path: '/' }); + setpartCookie(acces_right_token_name, "", { path: '/' }); + removeCookie(acces_right_token_name, { path: '/' }); } history.push("/recherche-formation"); } diff --git a/src/components/RechercheArticles.js b/src/components/RechercheArticles.js index e0f8ee6..40b841c 100644 --- a/src/components/RechercheArticles.js +++ b/src/components/RechercheArticles.js @@ -379,7 +379,14 @@ const RechercheArticles = (props) => { function part_logout_confirmation() { /* si c'est une connexion partner qui est active */ if (typeof (stored_part) != "undefined") { + + const stored_cookie = getCookie('tokenmysypart'); + var acces_right_token_name = stored_cookie+"_uar"; + setpartCookie("tokenmysypart", "", { path: '/' }); + + setpartCookie(acces_right_token_name, "", { path: '/' }); + removeCookie(acces_right_token_name, { path: '/' }); } history.push("/recherche-formation"); } diff --git a/src/components/Recherche_new_v2.js b/src/components/Recherche_new_v2.js index 4d13fc0..78e9f2f 100644 --- a/src/components/Recherche_new_v2.js +++ b/src/components/Recherche_new_v2.js @@ -2081,7 +2081,14 @@ const Recherche_new_v2 = () => { function part_logout_confirmation() { /* si c'est une connexion partner qui est active */ if (typeof (stored_part) != "undefined") { + const stored_cookie = getCookie('tokenmysypart'); + var acces_right_token_name = stored_cookie+"_uar"; + setpartCookie("tokenmysypart", "", { path: '/' }); + + setpartCookie(acces_right_token_name, "", { path: '/' }); + removeCookie(acces_right_token_name, { path: '/' }); + } history.push("/recherche-formation"); } diff --git a/src/components/SignIn.js b/src/components/SignIn.js index fbc3e13..1300343 100644 --- a/src/components/SignIn.js +++ b/src/components/SignIn.js @@ -28,6 +28,7 @@ import { Tooltip } from 'react-tooltip' function SignIn() { const [isconnected, setisconnected] = useState(""); + const [cookie_acces_right, setCookie_acces_right, removeCookie_acces_right] = useCookies(['mysy_user_access_right']); const [cookie, setCookie, removeCookie] = useCookies(['tokenmysych'], { path: '/' }); const [cookie_part, setCookie_part, removeCookie_part] = useCookies(['tokenmysypart'], { path: '/' }); const [retval, setretval] = useState("0"); @@ -111,13 +112,14 @@ function SignIn() { url_login = process.env.REACT_APP_API_URL + "myclass/api/partner_login/"; setmenucompte("partner"); partner_connexion = "partner"; + } else if (String(menucompte) === "user") { url_login = process.env.REACT_APP_API_URL + "myclass/api/login/"; setmenucompte("user"); partner_connexion = "user"; - + } // Gestion des Cookies @@ -157,8 +159,6 @@ function SignIn() { } - - fetch( url_login, { @@ -176,6 +176,16 @@ function SignIn() { if (String(partner_connexion) === String("partner")) { setCookie("tokenmysypart", JSON.parse(result['message']).token, { path: '/' }); + + var acces_right_token_name = String(JSON.parse(result['message']).token)+"_uar"; + var acces_right_token_val = JSON.parse(result['message']).user_access_right; + + //acces_right_token_val = [{'key1':'val1'}, {'key2':'val2'}]; + + console.log(" acces_right_token_val = ", acces_right_token_val); + + setCookie_acces_right(acces_right_token_name, acces_right_token_val, { path: '/' }); + //setCookie("tokenmysypart", result['message']); history.push("/Partner"); diff --git a/src/styles/components/_updateparnterinfo.scss b/src/styles/components/_updateparnterinfo.scss index f19f3bf..cc2ad13 100644 --- a/src/styles/components/_updateparnterinfo.scss +++ b/src/styles/components/_updateparnterinfo.scss @@ -14,6 +14,16 @@ .css-1o9s3wi-MuiInputBase-input-MuiOutlinedInput-input{ height: 2.5rem !important; + font-size: small; + } + + .css-1ixds2g{ + height: 2.5rem !important; + font-size: small !important; + } + + .css-1v4ccyo{ + font-size: small !important; } .text_pwd_crit{ @@ -984,4 +994,13 @@ padding-left: 5px !important; } + .css-1ixds2g{ + font-size: small !important; + height: 2rem !important; + } + + .css-1v4ccyo{ + font-size: small !important; + } + } \ No newline at end of file