feat(auth): separate anonymous entry from expired session recovery

This commit is contained in:
2026-10-20 03:52:48 +09:00
parent e5749b9be0
commit bfeee487fd
66 changed files with 3672 additions and 429 deletions
@@ -29,7 +29,12 @@ export function setupProjectionResponse(
}
if (path === "/api/auth/whoami") {
return Response.json({
actor: stages.get(mode) === "login" ? { ...user, auth_method: "browser_session" } : null,
session: stages.get(mode) === "login"
? { kind: "authenticated", expires_at: "2099-01-01T00:00:00Z" }
: { kind: "anonymous" },
actor: stages.get(mode) === "login"
? { ...user, auth_method: "browser_session" }
: null,
});
}
if (path === "/api/hosting/access") {
@@ -54,7 +59,10 @@ export function setupProjectionResponse(
return Response.json({ user });
}
if (path === "/api/auth/passkeys/login/options") {
return Response.json({ challenge_id: "fixture-login", public_key: { challenge: "dWk" } });
return Response.json({
challenge_id: "fixture-login",
public_key: { challenge: "dWk" },
});
}
if (path === "/api/auth/passkeys/login/complete") {
stages.set(mode, "login");