Skip to content

Fix/explicit rpid config - #585

Open
Davoski1 wants to merge 2 commits into
Miracle656:mainfrom
Davoski1:fix/explicit-rpid-config
Open

Fix/explicit rpid config#585
Davoski1 wants to merge 2 commits into
Miracle656:mainfrom
Davoski1:fix/explicit-rpid-config

Conversation

@Davoski1

Copy link
Copy Markdown

Summary

Supply the Relying Party ID (rpId) and origin explicitly in the wallet configuration so native builds do not fall back to localhost.

Changes

  • Update frontend/wallet/lib/network.ts
    • Add rpId and origin fields to walletConfig, read from NEXT_PUBLIC_RP_ID and NEXT_PUBLIC_ORIGIN.
  • Update examples/nextjs/src/lib/network.ts
    • Same environment-backed rpId / origin additions for the example app.

Why

Native apps (Expo / React Native) lack window.location.hostname, causing the SDK to default to localhost. That breaks passkey binding on real devices because the relying-party id must match the production domain. Reading rpId and origin from environment variables allows CI and device builds to set the correct production values without changing source.

Notes for maintainers / operators

  • Set NEXT_PUBLIC_RP_ID (e.g. veil.app) and NEXT_PUBLIC_ORIGIN (e.g. https://veil.app) in your environment/CI before building production artifacts.
  • Existing behavior is preserved when env vars are unset: the SDK will continue to resolve rpId/origin from window.location or its previous fallbacks.

Testing / Verification

  1. Build the app with NEXT_PUBLIC_RP_ID=veil.app and NEXT_PUBLIC_ORIGIN=https://veil.app set and verify walletConfig passed to useInvisibleWallet() contains those values.
  2. On a device, run register/authenticate flows and confirm passkeys are associated with the intended domain (not localhost).

Closes #442

@Davoski1
Davoski1 requested a review from Miracle656 as a code owner July 29, 2026 16:49
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

14. Global error boundary + Sentry

1 participant