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.

refactor: update error messages on login for enterprise

Brad Barbinfe51a0d7da1e
diff --git a/apps/erp/app/routes/_public+/callback.tsx b/apps/erp/app/routes/_public+/callback.tsx
index 1784756f04..fdc727446e 100644
--- a/apps/erp/app/routes/_public+/callback.tsx
+++ b/apps/erp/app/routes/_public+/callback.tsx
@@ -2,6 +2,7 @@ import {
assertIsPost,
callbackValidator,
carbonClient,
+ CONTROLLED_ENVIRONMENT,
error,
getCarbonServiceRole,
} from "@carbon/auth";
@@ -21,7 +22,7 @@ import type { ActionFunctionArgs, LoaderFunctionArgs } from "@vercel/remix";
import { json, redirect } from "@vercel/remix";
import { useEffect, useRef, useState } from "react";
-import { Alert, AlertDescription, AlertTitle, VStack } from "@carbon/react";
+import { Alert, AlertDescription, AlertTitle, cn, VStack } from "@carbon/react";
import { LuTriangleAlert } from "react-icons/lu";
import { path } from "~/utils/path";
@@ -154,7 +155,12 @@ export default function AuthCallback() {
</VStack>
</div>
) : (
- <div className="hexagon-loader-container">
+ <div
+ className={cn(
+ "hexagon-loader-container",
+ CONTROLLED_ENVIRONMENT && "grayscale"
+ )}
+ >
<div className="hexagon-loader">
<div className="hexagon" />
<div className="hexagon" />
diff --git a/apps/erp/app/routes/_public+/login.tsx b/apps/erp/app/routes/_public+/login.tsx
index 1d0287d851..03a9f1ffba 100644
--- a/apps/erp/app/routes/_public+/login.tsx
+++ b/apps/erp/app/routes/_public+/login.tsx
@@ -132,7 +132,7 @@ export async function action({ request }: ActionFunctionArgs): FormActionData {
} else if (CarbonEdition === Edition.Enterprise) {
// Enterprise edition does not support signup
return json(
- { success: false, message: "Invalid email/password combination" },
+ { success: false, message: "User record not found" },
await flash(request, error(null, "Failed to sign in"))
);
} else {
diff --git a/apps/mes/app/routes/_public+/callback.tsx b/apps/mes/app/routes/_public+/callback.tsx
index a8b6fc6d59..3a7dce3e59 100644
--- a/apps/mes/app/routes/_public+/callback.tsx
+++ b/apps/mes/app/routes/_public+/callback.tsx
@@ -2,6 +2,7 @@ import {
assertIsPost,
callbackValidator,
carbonClient,
+ CONTROLLED_ENVIRONMENT,
error,
getCarbonServiceRole,
} from "@carbon/auth";
@@ -26,6 +27,7 @@ import {
AlertDescription,
AlertTitle,
Button,
+ cn,
VStack,
} from "@carbon/react";
import { LuTriangleAlert } from "react-icons/lu";
@@ -163,7 +165,12 @@ export default function AuthCallback() {
</VStack>
</div>
) : (
- <div className="hexagon-loader-container">
+ <div
+ className={cn(
+ "hexagon-loader-container",
+ CONTROLLED_ENVIRONMENT && "grayscale"
+ )}
+ >
<div className="hexagon-loader">
<div className="hexagon" />
<div className="hexagon" />