summaryrefslogtreecommitdiff
path: root/app/routes/auth.register.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'app/routes/auth.register.tsx')
-rw-r--r--app/routes/auth.register.tsx19
1 files changed, 12 insertions, 7 deletions
diff --git a/app/routes/auth.register.tsx b/app/routes/auth.register.tsx
index 64f4c78..06f42f5 100644
--- a/app/routes/auth.register.tsx
+++ b/app/routes/auth.register.tsx
@@ -41,14 +41,19 @@ export async function action({ request }: Route.ActionArgs) {
userVerification: "required",
},
});
- // hints (L3) と extensions (L2) は古い iOS Safari が処理できないため除外
- // また alg: -8 (Ed25519) も互換性のため除外
- const { hints: _h, extensions: _e, ...safeOptions } = options as typeof options & { hints?: unknown; extensions?: unknown };
- safeOptions.pubKeyCredParams = safeOptions.pubKeyCredParams.filter(
- (p) => p.alg === -7 || p.alg === -257
- );
+ // iOS Safari の parseCreationOptionsFromJSON は unknown フィールドで SyntaxError を投げるため
+ // 必須フィールドのみ送信して原因を絞り込む
+ const minimalOptions = {
+ rp: options.rp,
+ user: options.user,
+ challenge: options.challenge,
+ pubKeyCredParams: options.pubKeyCredParams.filter(
+ (p) => p.alg === -7 || p.alg === -257
+ ),
+ };
+ console.log("[passkey] options sent to browser:", JSON.stringify(minimalOptions));
session.set("challenge", options.challenge);
- return Response.json(safeOptions, {
+ return Response.json(minimalOptions, {
headers: { "Set-Cookie": await commitSession(session) },
});
}