Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

Enhance account profile layout and update passkey service origins

naveenkash9f65c26a9c8b
diff --git a/apps/erp/app/routes/x+/account+/profile.tsx b/apps/erp/app/routes/x+/account+/profile.tsx
index 2fc7fdae77..a62e825170 100644
--- a/apps/erp/app/routes/x+/account+/profile.tsx
+++ b/apps/erp/app/routes/x+/account+/profile.tsx
@@ -290,7 +290,7 @@ export default function AccountProfile() {
};
return (
- <VStack spacing={4}>
+ <VStack spacing={4} className="pb-6">
<ProfileForm user={user} />
{passkeysEnabled && (
diff --git a/packages/auth/src/services/passkey.server.ts b/packages/auth/src/services/passkey.server.ts
index 114c507228..34bc104ad3 100644
--- a/packages/auth/src/services/passkey.server.ts
+++ b/packages/auth/src/services/passkey.server.ts
@@ -11,7 +11,7 @@ import type {
AuthenticatorTransportFuture,
RegistrationResponseJSON
} from "@simplewebauthn/types";
-import { DOMAIN, VERCEL_URL } from "../config/env";
+import { DOMAIN, ERP_URL, MES_URL, VERCEL_URL } from "../config/env";
// ── RP (Relying Party) configuration ────────────────────────────────────────
//
@@ -29,10 +29,15 @@ import { DOMAIN, VERCEL_URL } from "../config/env";
export const RP_ID =
DOMAIN && !DOMAIN.startsWith("localhost") ? DOMAIN : "localhost";
-/** The expected origin sent by the browser during registration/authentication. */
-const ORIGIN =
+/** The expected origin(s) sent by the browser during registration/authentication.
+ * Both ERP and MES subdomains share the same RP_ID (the parent DOMAIN), so a
+ * passkey registered on either app works on both — but @simplewebauthn checks
+ * origin exactly, so we pass an array of allowed origins. */
+const ORIGIN: string | string[] =
DOMAIN && !DOMAIN.startsWith("localhost")
- ? `https://${DOMAIN}`
+ ? [`https://${DOMAIN}`, ERP_URL, MES_URL].filter(
+ (url, idx, arr) => !!url && arr.indexOf(url) === idx
+ )
: VERCEL_URL?.startsWith("http")
? VERCEL_URL
: "http://localhost:3000";
diff --git a/packages/env/src/index.ts b/packages/env/src/index.ts
index d3e3911ac6..7e3829b871 100644
--- a/packages/env/src/index.ts
+++ b/packages/env/src/index.ts
@@ -418,6 +418,7 @@ export function getMESUrl() {
export function getBrowserEnv() {
return {
+ AUTH_PROVIDERS,
CARBON_EDITION,
CARBON_API_URL,
CLOUDFLARE_TURNSTILE_SITE_KEY,