summaryrefslogtreecommitdiff
path: root/app/routes/auth.register.tsx
diff options
context:
space:
mode:
authoryyamashita <yyamashita@hetzner.yyamashita.com>2026-06-20 00:08:33 +0900
committeryyamashita <yyamashita@hetzner.yyamashita.com>2026-06-20 00:08:33 +0900
commit0639f1e4fa26535427014aef60257bade3fd83ad (patch)
tree1b3f5f3acdc9a84f3df0a65298a35015994fce09 /app/routes/auth.register.tsx
parent8ba6da44510355a4b1335c14c78fde3a0fd030fe (diff)
Fix passkey registration on iOS: strip hints field and set displayName
hints is a WebAuthn L3 field that older iOS Safari cannot process, causing "String does not match expected pattern" TypeError. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'app/routes/auth.register.tsx')
-rw-r--r--app/routes/auth.register.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/routes/auth.register.tsx b/app/routes/auth.register.tsx
index 01b0699..2b5ad2a 100644
--- a/app/routes/auth.register.tsx
+++ b/app/routes/auth.register.tsx
@@ -34,14 +34,17 @@ export async function action({ request }: Route.ActionArgs) {
rpID,
userID: new Uint8Array([109, 105, 99, 114, 111, 98, 108, 111, 103]), // "microblog"
userName: "admin",
+ userDisplayName: "admin",
attestationType: "none",
authenticatorSelection: {
residentKey: "required",
userVerification: "required",
},
});
+ // hints は WebAuthn L3 の新フィールドで古い iOS が処理できないため除外
+ const { hints: _hints, ...safeOptions } = options as typeof options & { hints?: unknown };
session.set("challenge", options.challenge);
- return Response.json(options, {
+ return Response.json(safeOptions, {
headers: { "Set-Cookie": await commitSession(session) },
});
}