summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authoryyamashita <yyamashita@hetzner.yyamashita.com>2026-06-20 00:35:47 +0900
committeryyamashita <yyamashita@hetzner.yyamashita.com>2026-06-20 00:35:47 +0900
commit9232c6c29514df0cb20f27fb7157baf5ed1a255b (patch)
treedff0edde174ffba46235faa0aa64b2de42a93485 /app
parentc205e6ad73f14db1f7efdf1e4e4b594eb73a1f34 (diff)
Debug: force render between steps, remove rp.id from native options
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'app')
-rw-r--r--app/routes/auth.register.tsx18
1 files changed, 8 insertions, 10 deletions
diff --git a/app/routes/auth.register.tsx b/app/routes/auth.register.tsx
index 28d5b03..7d8fb5d 100644
--- a/app/routes/auth.register.tsx
+++ b/app/routes/auth.register.tsx
@@ -120,29 +120,33 @@ export default function Register() {
const [step, setStep] = useState("");
async function handleRegister() {
+ const tick = () => new Promise<void>((r) => setTimeout(r, 50));
setStatus("loading");
setErrorMsg("");
setStep("");
try {
- setStep("1. options 取得中…");
+ setStep("1a. fetch 中…"); await tick();
const optRes = await fetch("/auth/register?intent=options", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ token }),
});
+ setStep("1b. fetch 完了 status=" + optRes.status); await tick();
if (!optRes.ok) {
const err = await optRes.json();
throw new Error(err.error ?? "オプション取得に失敗しました");
}
const optJSON = await optRes.json();
- setStep("2. options 受信 OK → credentials.create() 呼び出し中…");
+ setStep("1c. JSON パース OK"); await tick();
const userId = b64urlToBuffer(optJSON.user.id);
const challenge = b64urlToBuffer(optJSON.challenge);
+ setStep("2. credentials.create() 呼び出し中…"); await tick();
+ // rp.id / authenticatorSelection / attestation を省略して最小構成で試す
const credential = await navigator.credentials.create({
publicKey: {
- rp: optJSON.rp,
+ rp: { name: optJSON.rp.name },
user: {
id: userId,
name: optJSON.user.name,
@@ -150,17 +154,11 @@ export default function Register() {
},
challenge,
pubKeyCredParams: optJSON.pubKeyCredParams,
- timeout: 60000,
- attestation: "none",
- authenticatorSelection: {
- residentKey: "required" as ResidentKeyRequirement,
- userVerification: "required" as UserVerificationRequirement,
- },
},
}) as PublicKeyCredential | null;
if (!credential) throw new Error("クレデンシャルの作成に失敗しました");
- setStep("3. credential 取得 OK → サーバー送信中…");
+ setStep("3. credential 取得 OK → サーバー送信中…"); await tick();
const attestation = credential.response as AuthenticatorAttestationResponse;
const regResponse: RegistrationResponseJSON = {