This commit is contained in:
2025-11-28 16:55:45 +01:00
parent f22979a44a
commit 881476122c
54 changed files with 7628 additions and 5654 deletions

View File

@@ -48,7 +48,6 @@ const Login = () => {
return;
}
// Redirection vers le dashboard
navigate('/dashboard');
} catch (error) {
@@ -67,7 +66,6 @@ const Login = () => {
};
return (
<div className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 flex flex-col lg:flex-row">
{/* Image côté gauche */}
<div className="h-32 lg:h-auto lg:flex lg:w-1/2 bg-cover bg-center"
@@ -91,8 +89,9 @@ const Login = () => {
GESTION DES TEMPS ET DES ACTIVITÉS
</p>
</div>
{/* Bouton Office 365 */}
<div>
<div className="mb-4">
<button
data-testid="o365-login-btn"
onClick={handleO365Login}
@@ -113,6 +112,63 @@ const Login = () => {
</button>
</div>
{/* Séparateur */}
<div className="flex items-center my-4">
<div className="flex-1 h-px bg-gray-200" />
<span className="px-3 text-xs text-gray-500">ou connexion locale</span>
<div className="flex-1 h-px bg-gray-200" />
</div>
{/* Formulaire local email/mot de passe */}
<form onSubmit={handleSubmit} className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-1">
Email professionnel
</label>
<input
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
required
className="w-full px-3 py-2 border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"
placeholder="prenom.nom@ensup.fr"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-1">
Mot de passe
</label>
<div className="relative">
<input
type={showPassword ? 'text' : 'password'}
value={password}
onChange={(e) => setPassword(e.target.value)}
required
className="w-full px-3 py-2 border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 pr-10"
placeholder="••••••••"
/>
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
className="absolute inset-y-0 right-0 px-3 text-xs text-gray-500"
>
{showPassword ? 'Masquer' : 'Afficher'}
</button>
</div>
</div>
<button
type="submit"
disabled={isLoading && authMethod === 'local'}
className="w-full bg-indigo-600 text-white py-2.5 rounded-lg text-sm font-medium hover:bg-indigo-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
>
{isLoading && authMethod === 'local'
? 'Connexion...'
: 'Se connecter'}
</button>
</form>
{/* Message d'erreur */}
{error && (
<div className="p-3 bg-red-50 border border-red-200 rounded-lg mt-4">
@@ -135,8 +191,8 @@ const Login = () => {
</div>
</div>
</div>
</div>
</div>
);
};
export default Login;
export default Login;