summaryrefslogtreecommitdiff
path: root/app/routes
diff options
context:
space:
mode:
Diffstat (limited to 'app/routes')
-rw-r--r--app/routes/auth.register.tsx10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/routes/auth.register.tsx b/app/routes/auth.register.tsx
index 2b5ad2a..64f4c78 100644
--- a/app/routes/auth.register.tsx
+++ b/app/routes/auth.register.tsx
@@ -41,8 +41,12 @@ export async function action({ request }: Route.ActionArgs) {
userVerification: "required",
},
});
- // hints は WebAuthn L3 の新フィールドで古い iOS が処理できないため除外
- const { hints: _hints, ...safeOptions } = options as typeof options & { hints?: unknown };
+ // 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
+ );
session.set("challenge", options.challenge);
return Response.json(safeOptions, {
headers: { "Set-Cookie": await commitSession(session) },
@@ -127,7 +131,7 @@ export default function Register() {
window.location.href = "/";
} catch (e) {
setStatus("error");
- setErrorMsg(e instanceof Error ? e.message : "エラーが発生しました");
+ setErrorMsg(e instanceof Error ? `${e.name}: ${e.message}` : String(e));
}
}