From 7c41beb9920722368e94454b0271ee2cb6891511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Sat, 3 Jan 2026 12:08:58 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20erreur=20explicite=20lors=20de=20l'?= =?UTF-8?q?=C3=A9chec=20de=20connexion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/auth/[...nextauth]/options.js | 4 ---- app/login/form.js | 4 +++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/api/auth/[...nextauth]/options.js b/app/api/auth/[...nextauth]/options.js index 749393a..1352d41 100644 --- a/app/api/auth/[...nextauth]/options.js +++ b/app/api/auth/[...nextauth]/options.js @@ -22,10 +22,6 @@ export const options = { const user = await res.json() - if (!res.ok && user) { - throw new Error('E-mail ou mot de passe incorrect') - } - if (res.ok && user) { return user } diff --git a/app/login/form.js b/app/login/form.js index ceb9a2a..6d9cd9a 100644 --- a/app/login/form.js +++ b/app/login/form.js @@ -19,7 +19,9 @@ export default function LoginForm() { }) if (response?.error) { - if (response.error === 'Configuration') { + if (response.error === 'CredentialsSignin') { + setError('E-mail ou mot de passe incorrect') + } else if (response.error === 'Configuration') { setError('Une erreur s’est produite, contactez l’administrateur !') } else { setError(response.error)