merge: fix/51-auth-status-unavailable dans develop (première connexion utilisable quand le statut d'authentification est indisponible — correctif #51)
This commit is contained in:
@ -24,7 +24,7 @@ export function LoginPage({ onSessionChange }: { onSessionChange: () => Promise<
|
|||||||
setEmail((current) => current || nextStatus.initialAdminEmail);
|
setEmail((current) => current || nextStatus.initialAdminEmail);
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
if (alive) setError("Statut d'authentification indisponible.");
|
// Auth status only enriches the unauthenticated screen; login must remain usable without it.
|
||||||
});
|
});
|
||||||
return () => {
|
return () => {
|
||||||
alive = false;
|
alive = false;
|
||||||
|
|||||||
14
apps/web/src/pages/LoginPageAuthStatusUnavailable.test.ts
Normal file
14
apps/web/src/pages/LoginPageAuthStatusUnavailable.test.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { readFileSync } from "node:fs";
|
||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
|
||||||
|
describe("login page when auth status is unavailable", () => {
|
||||||
|
it("keeps the unauthenticated login screen usable without a blocking auth status error", () => {
|
||||||
|
const source = readFileSync(new URL("./LoginPage.tsx", import.meta.url), "utf8");
|
||||||
|
|
||||||
|
expect(source).toContain("<form onSubmit={submit} className=\"stack-form\">");
|
||||||
|
expect(source).toContain('type="email" required');
|
||||||
|
expect(source).toContain('type="password" required');
|
||||||
|
expect(source).toContain('type="submit"');
|
||||||
|
expect(source).not.toContain("Statut d'authentification indisponible");
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user