Fix login error feedback + load basecoat toast module

- inline error message on the login form (401 shows a visible French
  message, hidden again on submit)
- import basecoat-css/toast in BaseLayout: every showToast in the app
  was silently no-oping because the toast JS was never loaded
This commit is contained in:
2026-07-28 23:30:18 +02:00
parent c5378f6008
commit fd2d5408d6
3 changed files with 22 additions and 18 deletions
+7 -4
View File
@@ -69,9 +69,12 @@ export const POST: APIRoute = async ({ request, cookies }) => {
});
} catch (err) {
console.error("Login failed:", err);
return new Response(JSON.stringify({ error: "Invalid credentials" }), {
status: 401,
headers: { "Content-Type": "application/json" },
});
return new Response(
JSON.stringify({ error: "Email ou mot de passe incorrect" }),
{
status: 401,
headers: { "Content-Type": "application/json" },
},
);
}
};