Repository navigation
feat(console): turn passkeys on with a domain picker instead of a disabled toggle - #14313
Conversation
|
Review complete. 🟠 1 high 💬 Inline comments (1)
This PR introduces a dedicated Enable Passkeys dialog, reworks the Passkey relying-party policy card (suggested rpIds, custom origins rows), centralizes origin/rpId derivation in
Reviewed commit: d91399f |
🟢 Tier S · Ready to mergeThis change replaces the disabled Passkey toggle setup hint with a domain-selection dialog that saves the relying party ID before enabling the auth method. The policy card now displays server-reported origins, with platform-based previews and suggestions for unsaved domains.
📂 Walkthrough · 6
Reviewed |
There was a problem hiding this comment.
The PR reworks the passkeys enable flow in the Console (policy card, enable dialog, shared passkey-policy helpers, and mocked e2e coverage), with one high-severity fail-closed issue around empty stored origins.
Key findings
- 🟠 Server fails closed on policy enabled with empty origins — passkey-policy.ts:49
…abled toggle The Passkey toggle was the only auth method that started disabled behind a policy hint. Turning it on now asks for the domain in place, suggested from the project's web platforms, and shows where passkeys will work; projects with a localhost platform turn on straight away. The policy card shows the origins that come from web platforms and keeps the explicit list as an optional override.
…om origins The server now computes passkey origins from the project's platforms and no longer accepts a list, so the policy card reads them back instead of mirroring the rules, and the origins editor is gone. An unsaved domain is still previewed from the platforms.
…region Region-specific console variables can name different shared domains, and the domain picker must never offer a shared parent.
53ad8ad to
5b018b7
Compare
|
@hansi-codes review |
A hand-written suffix list offered ne.jp for app.example.ne.jp, which the server rejects. tldts follows the same public suffix list as the server, private suffixes such as github.io included.
|
@hansi-codes review |
What does this PR do?
Passkey was the only auth method that started disabled, with "Set a relying party ID and origins in passkey policies to enable" under its toggle. This PR keeps the one decision that's genuinely the developer's (which domain passkeys are bound to) and makes it part of turning the method on.
Depends on #14310. The server now takes passkey origins only from the project's platforms and returns them read-only on the policy; the dialog saves only the domain. Merge and deploy #14310 (and ship it to Cloud) before tagging a Console release with this.
localhostweb platform, the toggle turns on straight away. Whether passkeys are ready comes from the server'sorigins, not a client-side copy of the rules.origins(localhost once, for any port). An unsaved domain is previewed from the platforms. The origins editor is gone.Before
After
Auth methods: the toggle is enabled, with no setup hint.
Turning Passkey on asks for the domain, suggested from the
app.example.comweb platform, and shows where passkeys will work.One click later the method is on.
The policy card shows where passkeys work, as computed by the server.
Adding a
localhostweb platform covers local development on any port.Without a web platform on the chosen domain, the dialog says what is missing and Enable stays disabled.
Test Plan
e2e/console.mocked.passkeys.spec.ts: 12 tests covering the dialog, suggestions, the request payloads (rpIdonly), localhost, the missing-platform state, and the card readingoriginsback.tscare clean on the changed files.Related PRs and Issues
Server side: #14310.
Related: appwrite-labs/cloud#5805