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.

fix: /callback logs why it left an invitee's invite open

Sidwebworksc93daff412ff
diff --git a/apps/erp/app/routes/_public+/callback.tsx b/apps/erp/app/routes/_public+/callback.tsx
index d72f39ed42..213fee3abc 100644
--- a/apps/erp/app/routes/_public+/callback.tsx
+++ b/apps/erp/app/routes/_public+/callback.tsx
@@ -99,6 +99,12 @@ export async function action({ request }: ActionFunctionArgs) {
: (companyLookup?.data ?? []);
// A failed read is not "no company": nothing is accepted on its say-so.
const membershipKnown = !employeeLookup.error && !companyLookup?.error;
+ if (!membershipKnown) {
+ logger.error("Failed to read memberships on sign-in", {
+ error: employeeLookup.error ?? companyLookup?.error,
+ userId
+ });
+ }
const cookieCompanyId = getCompanyId(request);
const match =
@@ -480,6 +486,13 @@ export async function action({ request }: ActionFunctionArgs) {
.limit(1)
.maybeSingle();
+ if (pendingInvite.error) {
+ logger.error("Failed to look up a pending invite on sign-in", {
+ error: pendingInvite.error,
+ userId: authSession.userId
+ });
+ }
+
if (pendingInvite.data) {
const accept = await acceptInvite(
serviceRole,