You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a new user accepts an invite and tries to register a passkey, the WebAuthn registration fails with "Security error. Make sure you're on a secure connection."
Root Cause
packages/core/src/astro/routes/api/auth/invite/register-options.ts line 55 calls getPasskeyConfig(url, siteName)without passing the siteUrl parameter:
This causes getPasskeyConfig to fall back to url.hostname, which is the internal hostname (localhost) when running behind a TLS-terminating reverse proxy (Traefik, nginx, etc.). The browser then rejects the WebAuthn registration because the RP ID (localhost) does not match the actual origin (staging.example.com).
Expected Behavior
The invite register-options endpoint should resolve the public origin the same way every other passkey endpoint does:
All other passkey registration endpoints correctly pass siteUrl:
Endpoint
File
Passes siteUrl?
Admin setup
setup/admin.ts:67-68
✅
Add passkey (authed)
passkey/register/options.ts:56-57
✅
Passkey login
passkey/options.ts:67-68
✅
Passkey verify
passkey/verify.ts:38-43
✅
Signup complete
signup/complete.ts:42-47
✅
Invite complete
invite/complete.ts:42-47
✅
Invite register-options
invite/register-options.ts:55
❌
Reproduction
Deploy EmDash behind a TLS-terminating reverse proxy with EMDASH_SITE_URL=https://staging.example.com
Log in as admin and invite a new user
New user opens invite link (correctly shows https://staging.example.com)
User tries to register a passkey → "Security error" because the WebAuthn RP ID is localhost
Environment
EmDash via Docker (Node.js adapter)
Behind Traefik reverse proxy (TLS termination)
EMDASH_SITE_URL set correctly in container env
Passkey login works fine for existing admin users (only invite flow is broken)
I patched the bundled register-options_D9cNRkR4.mjs on our staging deployment to confirm the diagnosis:
+import { a as getPublicOrigin } from ./public-url_CaGH3ATc.mjs;- const passkeyConfig = getPasskeyConfig(url, siteName);+ const siteUrl = getPublicOrigin(url, emdash?.config);+ const passkeyConfig = getPasskeyConfig(url, siteName, siteUrl);
Before patch: invite passkey registration fails with "Security error. Make sure you're on a secure connection." — the browser rejects the WebAuthn call because rpId is localhost instead of the actual domain.
After patch: invite passkey registration works correctly. The new user can register their passkey and log in.
The fix is confirmed. The one-line change (resolving siteUrl via getPublicOrigin before calling getPasskeyConfig) is all that is needed.
Activity
digi4care commentedon May 11, 2026
Proof of fix
I patched the bundled
register-options_D9cNRkR4.mjson our staging deployment to confirm the diagnosis:Before patch: invite passkey registration fails with
"Security error. Make sure you're on a secure connection."— the browser rejects the WebAuthn call becauserpIdislocalhostinstead of the actual domain.After patch: invite passkey registration works correctly. The new user can register their passkey and log in.
The fix is confirmed. The one-line change (resolving
siteUrlviagetPublicOriginbefore callinggetPasskeyConfig) is all that is needed.ascorbic commentedon May 12, 2026
/bonk fix this pls
ask-bonk commentedon May 12, 2026
Created PR #1000
github run