ajout du dashboard
Deploy Nexus Portal to HestiaCP (FTP) / build-and-deploy (push) Successful in 16s
Deploy Nexus Portal to HestiaCP (FTP) / build-and-deploy (push) Successful in 16s
This commit is contained in:
@@ -18,6 +18,21 @@ export default function Register() {
|
||||
e.preventDefault();
|
||||
setError(null);
|
||||
|
||||
// 1. DÉFINITION DE LA POLITIQUE DE MOT DE PASSE (Le Checkpoint)
|
||||
// Explication de la Regex :
|
||||
// (?=.*[a-z]) : Au moins une minuscule
|
||||
// (?=.*[A-Z]) : Au moins une majuscule
|
||||
// (?=.*\d) : Au moins un chiffre
|
||||
// (?=.*[\W_]) : Au moins un caractère spécial (non-alphanumérique ou underscore)
|
||||
// .{8,} : Minimum 8 caractères au total
|
||||
const passwordPolicy = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_]).{8,}$/;
|
||||
|
||||
// 2. VÉRIFICATION
|
||||
if (!passwordPolicy.test(password)) {
|
||||
setError("ERREUR : Le mot de passe doit contenir 8 caractères min, une majuscule, une minuscule, un chiffre et un caractère spécial.");
|
||||
return; // On stoppe l'exécution ici. La requête ne part pas vers le serveur.
|
||||
}
|
||||
|
||||
// Sécurité Frontend : Validation des mots de passe avant envoi au serveur
|
||||
if (password !== confirmPassword) {
|
||||
setError("Les clés d'accès (mots de passe) ne correspondent pas.");
|
||||
@@ -36,9 +51,9 @@ export default function Register() {
|
||||
try {
|
||||
// Envoi de la requête groupée à notre orchestrateur PHP backend
|
||||
await registerUnifiedClient(email, username, password, firstName, lastName);
|
||||
|
||||
|
||||
alert("[ PROVISIONNEMENT RÉUSSI ]\nVos comptes FOSSBilling, HestiaCP et Nextcloud ont été initialisés.\nVous pouvez maintenant vous connecter.");
|
||||
|
||||
|
||||
// Redirection automatique vers la page de login après succès
|
||||
navigate('/login');
|
||||
} catch (err) {
|
||||
@@ -50,8 +65,8 @@ export default function Register() {
|
||||
|
||||
// Réutilisation de ton Design System "Bunker"
|
||||
const inputStyle = {
|
||||
width: '100%', padding: '10px', marginBottom: '15px',
|
||||
backgroundColor: '#1A1A1A', color: '#00E5FF',
|
||||
width: '100%', padding: '10px', marginBottom: '15px',
|
||||
backgroundColor: '#1A1A1A', color: '#00E5FF',
|
||||
border: '1px solid #333', fontFamily: 'monospace', outline: 'none',
|
||||
boxSizing: 'border-box'
|
||||
};
|
||||
@@ -65,8 +80,8 @@ export default function Register() {
|
||||
|
||||
return (
|
||||
<div style={{ display: 'flex', justifyContent: 'center', marginTop: '5vh', padding: '0 20px' }}>
|
||||
<div style={{
|
||||
width: '100%', maxWidth: '500px', backgroundColor: '#242424',
|
||||
<div style={{
|
||||
width: '100%', maxWidth: '500px', backgroundColor: '#242424',
|
||||
padding: '30px', borderTop: '4px solid #00E5FF', boxShadow: '0 10px 30px rgba(0,0,0,0.5)'
|
||||
}}>
|
||||
<h2 style={{ color: '#FFF', textTransform: 'uppercase', marginBottom: '5px', fontSize: '1.5rem' }}>
|
||||
@@ -76,9 +91,17 @@ export default function Register() {
|
||||
[ INITIALISATION DU PROVISIONNEMENT TRIPLE EN CASCADE ]
|
||||
</p>
|
||||
|
||||
{/* Affichage des alertes système */}
|
||||
{error && (
|
||||
<div style={{ backgroundColor: 'rgba(255, 68, 68, 0.1)', color: '#FF4444', padding: '10px', marginBottom: '20px', border: '1px solid #FF4444', fontSize: '0.9rem', fontFamily: 'monospace' }}>
|
||||
[ ERREUR ] : {error}
|
||||
<div style={{
|
||||
color: '#ff003c', // Un rouge néon agressif pour les erreurs
|
||||
border: '1px solid #ff003c',
|
||||
backgroundColor: 'rgba(255, 0, 60, 0.1)',
|
||||
padding: '10px',
|
||||
marginBottom: '15px',
|
||||
fontFamily: 'monospace'
|
||||
}}>
|
||||
[ ALERTE SYSTÈME ] : {error}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user