fix: erreur explicite lors de l'échec de connexion
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
+3
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user