28/09/23 - 23h

recette2
cherif 2023-09-28 22:22:38 +02:00
parent a8442c2419
commit ce49bf491b
7 changed files with 65 additions and 6 deletions

View File

@ -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',

View File

@ -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',

View File

@ -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");
}

View File

@ -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");
}

View File

@ -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");
}

View File

@ -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");
@ -112,6 +113,7 @@ function SignIn() {
setmenucompte("partner");
partner_connexion = "partner";
}
else if (String(menucompte) === "user") {
url_login = process.env.REACT_APP_API_URL + "myclass/api/login/";
@ -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");

View File

@ -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;
}
}