Maj Section Général
This commit is contained in:
1 parent
01526a5551
commit
032a370e7d
15 files changed
+492
-57
No files matched your search
@@ -308,6 +308,13 @@ function ResendInviteModal({ user, onClose, onSuccess, onError }) {
|
||||
|
||||
// ── Modale création utilisateur ────────────────────────────────────────────
|
||||
function CreateUserModal({ open, onClose, onCreated }) {
|
||||
const [minPasswordLength, setMinPasswordLength] = useState(8);
|
||||
useEffect(() => {
|
||||
fetch('/api/app-info').then(r => r.json()).then(d => {
|
||||
if (d.minPasswordLength) setMinPasswordLength(d.minPasswordLength);
|
||||
}).catch(() => {});
|
||||
}, []);
|
||||
|
||||
const [form, setForm] = useState({ email: '', password: '', displayName: '', role: 'user' });
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [err, setErr] = useState(null);
|
||||
@@ -356,8 +363,8 @@ function CreateUserModal({ open, onClose, onCreated }) {
|
||||
</div>
|
||||
<div>
|
||||
<label>Mot de passe *</label>
|
||||
<input type="password" required minLength={8} autoComplete="new-password" value={form.password} onChange={e => set('password', e.target.value)} placeholder="8 caractères minimum" />
|
||||
<PasswordStrength password={form.password} />
|
||||
<input type="password" required minLength={minPasswordLength} autoComplete="new-password" value={form.password} onChange={e => set('password', e.target.value)} placeholder={`${minPasswordLength} caractères minimum`} />
|
||||
<PasswordStrength password={form.password} minLength={minPasswordLength} />
|
||||
</div>
|
||||
<div>
|
||||
<label>Rôle</label>
|
||||
|
||||
Reference in new issue
Block a user