feat(auth): real JWT login, RBAC routes, RGPD cookie banner + users/journal admin
Build & Deploy / build (push) Successful in 11s
Build & Deploy / build (push) Successful in 11s
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
/* Bandeau de consentement aux cookies (RGPD) */
|
||||
|
||||
import { useState } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import styles from './CookieBanner.module.css';
|
||||
|
||||
const CONSENT_KEY = 'ds_cookies_consent';
|
||||
const CONSENT_VERSION = 1;
|
||||
|
||||
export default function CookieBanner() {
|
||||
/* Affiché tant qu'aucune décision n'a été enregistrée */
|
||||
const [visible, setVisible] = useState(() => localStorage.getItem(CONSENT_KEY) === null);
|
||||
|
||||
if (!visible) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* Enregistre la décision de l'utilisateur (accept / refuse) */
|
||||
function enregistrerChoix(choice) {
|
||||
const decision = { choice, date: new Date().toISOString(), version: CONSENT_VERSION };
|
||||
localStorage.setItem(CONSENT_KEY, JSON.stringify(decision));
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.banner} role="dialog" aria-label="Consentement aux cookies">
|
||||
<div className={styles.content}>
|
||||
<p className={styles.text}>
|
||||
Nous utilisons des cookies pour assurer le bon fonctionnement de la plateforme.
|
||||
Vous pouvez accepter ou refuser leur utilisation. Pour en savoir plus, consultez nos{' '}
|
||||
<Link to="/mentions-legales" className={styles.link}>mentions légales</Link> et nos{' '}
|
||||
<Link to="/cgu" className={styles.link}>CGU</Link>.
|
||||
</p>
|
||||
<div className={styles.actions}>
|
||||
<button
|
||||
type="button"
|
||||
className={styles.btnRefuse}
|
||||
onClick={() => enregistrerChoix('refuse')}
|
||||
>
|
||||
Refuser
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={styles.btnAccept}
|
||||
onClick={() => enregistrerChoix('accept')}
|
||||
>
|
||||
Tout accepter
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/* Bandeau de consentement aux cookies (RGPD) */
|
||||
|
||||
.banner {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
background-color: var(--color-white);
|
||||
border-top: 3px solid var(--color-primary);
|
||||
box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
|
||||
padding: 16px 24px;
|
||||
}
|
||||
|
||||
.content {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 24px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 13px;
|
||||
color: var(--color-text);
|
||||
margin: 0;
|
||||
flex: 1;
|
||||
min-width: 240px;
|
||||
}
|
||||
|
||||
.link {
|
||||
color: var(--color-link);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.btnAccept {
|
||||
padding: 9px 18px;
|
||||
background-color: var(--color-primary);
|
||||
color: var(--color-white);
|
||||
border: none;
|
||||
border-radius: var(--radius);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.15s;
|
||||
}
|
||||
|
||||
.btnAccept:hover {
|
||||
background-color: var(--color-primary-dark);
|
||||
}
|
||||
|
||||
.btnRefuse {
|
||||
padding: 9px 18px;
|
||||
background-color: var(--color-white);
|
||||
color: var(--color-text);
|
||||
border: 1px solid var(--color-gray-border);
|
||||
border-radius: var(--radius);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.15s;
|
||||
}
|
||||
|
||||
.btnRefuse:hover {
|
||||
background-color: var(--color-danger-bg);
|
||||
}
|
||||
Reference in New Issue
Block a user