Fix/explicit rpid config - #585
Conversation
…e .well-known files for passkeys
…C_RP_ID / NEXT_PUBLIC_ORIGIN)
|
@rhoggs-bot-test-account is attempting to deploy a commit to the miracle656's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Needs a rebase onto |
|
Apologies — this sat unreviewed for a month while What happened: PR #508 (
And the domain-association files are now hosted for real, not as examples: So the gap you were closing is closed. I have checked One part of this is NOT superseded, and it is worth salvaging. Your change to rpId: process.env.NEXT_PUBLIC_RP_ID?.trim() || undefined,
origin: process.env.NEXT_PUBLIC_ORIGIN?.trim() || undefined,
Two thoughts if you want to re-open it as a small focused PR:
So: the three Expo/well-known files here are superseded, but those two lines are not. A PR with just them, plus a note in the env documentation about the preview-URL case, would land. Not closing this. Sorry for the month. |
Summary
Supply the Relying Party ID (rpId) and origin explicitly in the wallet configuration so native builds do not fall back to
localhost.Changes
frontend/wallet/lib/network.tsrpIdandoriginfields towalletConfig, read fromNEXT_PUBLIC_RP_IDandNEXT_PUBLIC_ORIGIN.examples/nextjs/src/lib/network.tsrpId/originadditions for the example app.Why
Native apps (Expo / React Native) lack
window.location.hostname, causing the SDK to default tolocalhost. That breaks passkey binding on real devices because the relying-party id must match the production domain. ReadingrpIdandoriginfrom environment variables allows CI and device builds to set the correct production values without changing source.Notes for maintainers / operators
NEXT_PUBLIC_RP_ID(e.g.veil.app) andNEXT_PUBLIC_ORIGIN(e.g.https://veil.app) in your environment/CI before building production artifacts.Testing / Verification
NEXT_PUBLIC_RP_ID=veil.appandNEXT_PUBLIC_ORIGIN=https://veil.appset and verifywalletConfigpassed touseInvisibleWallet()contains those values.localhost).Closes #442