import { useState, useEffect, useRef } from 'react'; import { Link, useNavigate } from 'react-router-dom'; import { useAuth } from '../context/AuthContext.jsx'; import { api } from '../api.js'; import AuthBgCol from '../components/AuthBgCol.jsx'; import PasswordInput from '../components/PasswordInput.jsx'; // ── Helpers ──────────────────────────────────────────────────────────────── const DEVICE_KEY = 'cl_device_token'; function fmtCountdown(sec) { const m = Math.floor(sec / 60).toString().padStart(2, '0'); const s = (sec % 60).toString().padStart(2, '0'); return `${m}:${s}`; } // ── Header logo (colonne droite) ────────────────────────────────────────── function AppHeader({ appInfo }) { return (
Connectez-vous à votre compte
Pas encore de compte ?{' '} Créer un compte
)} > )} {/* ══ ÉTAPE 2 : Choix de méthode 2FA ══════════════════════════ */} {step === 'method' && ( <>Choisissez votre méthode de vérification
{method === 'totp' ? 'Entrez le code à 6 chiffres affiché dans votre application d\'authentification.' : <>Code envoyé à {email}.> }