Title: fix(idp): passkey login degrades on WebView/insecure contexts instead of crashing — closes #556 by melvincarvalho · Pull Request #558 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: fix(idp): passkey login degrades on WebView/insecure contexts instead of crashing — closes #556 by melvincarvalho · Pull Request #558 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: fix(idp): passkey login degrades on WebView/insecure contexts instead of crashing — closes #556 by melvincarvalho · Pull Request #558 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Closes #556. Port-back from jspod#65, but JSS can fix it better than jspod could. The two problems on stale WebViews (de-Googled phones) crypto.randomUUID crash. loginPage's inline JS built a visitorId with crypto.randomUUID() — absent on Chromium <92 / non-secure contexts → Sign in with Passkey threw crypto.randomUUID is not a function. WebAuthn-unavailable crash. Even past that, both ceremonies (navigator.credentials.get/create) fail with a cryptic error on a WebView that can't do WebAuthn. Why JSS's fix is cleaner than jspod's polyfill jspod had to polyfill randomUUID because the call lives inside the solid-oidc library it imports. JSS owns the call site. And the call was redundant: authenticationOptions (passkey.js:226) already mints the challengeKey via Node's always-available crypto.randomUUID() and returns it (:236), and the client already echoes options.challengeKey on verify (views.js:298). So the browser call generated a value the server immediately overrode. Fix 1: drop the client crypto.randomUUID(); send {}. Server mints the key, client echoes it — functionally identical, zero browser crypto. Fix 2: an up-front isSecureContext + PublicKeyCredential + credentials.get/create guard on both loginWithPasskey and registerPasskey that steers the user to the password form (login) or "Skip for now" (prompt) — both already on the page. This addresses jspod#65's own caveat: the polyfill only fixes randomUUID, never the WebAuthn/secure-context gate, which is the real wall. We can't make passkeys work on those WebViews (nobody can), but the page now degrades cleanly to password/Schnorr login instead of erroring. Tests test/passkey-webauthn-degrade.test.js (5 — the first direct passkey-endpoint coverage, noted missing when #78 closed): no crypto.randomUUID() call survives in the served JS; empty options body is sent both pages carry the secure-context/WebAuthn guard every inline