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:
@@ -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" },
|
||||
},
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user