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.

feat(auth): sign-in codes, same-browser links, and Auth's emails as React Email (#2004)

Sid1dd4cabc994e
diff --git a/apps/erp/app/routes/_public+/callback.tsx b/apps/erp/app/routes/_public+/callback.tsx
index fee9f1e5ad..90a00bf38e 100644
--- a/apps/erp/app/routes/_public+/callback.tsx
+++ b/apps/erp/app/routes/_public+/callback.tsx
@@ -37,7 +37,7 @@ import {
migrateUserToSso
} from "@carbon/ee/sso.server";
import { validator } from "@carbon/form";
-import { AccountLockout, redis } from "@carbon/kv";
+import { AccountLockout, redis, SIGN_IN_CODE_LOCKOUT_PREFIX } from "@carbon/kv";
import { getLogger } from "@carbon/logger";
import {
Alert,
@@ -349,6 +349,10 @@ export async function action({ request }: ActionFunctionArgs) {
authSession.ssoProviderId = ssoProviderId;
await new AccountLockout({ redis }).reset(authSession.email);
+ await new AccountLockout({
+ redis,
+ prefix: SIGN_IN_CODE_LOCKOUT_PREFIX
+ }).reset(authSession.email);
// The IdP owns MFA for SSO sessions, including controlled environments
// (user decision — attestation shifts to the IdP policy).
@@ -447,6 +451,10 @@ export async function action({ request }: ActionFunctionArgs) {
// accumulated per-account lockout state (NIST 3.1.8 reset-on-success). Runs
// before the TOTP gate so an MFA-enrolled user's counter clears too.
await new AccountLockout({ redis }).reset(authSession.email);
+ await new AccountLockout({
+ redis,
+ prefix: SIGN_IN_CODE_LOCKOUT_PREFIX
+ }).reset(authSession.email);
// TOTP gate: park the tokens in the pending-MFA key and challenge before
// any full session cookie exists. The /mfa action mints the real session.
diff --git a/apps/erp/app/routes/_public+/login.tsx b/apps/erp/app/routes/_public+/login.tsx
index a37d7d2317..b15dd490c0 100644
--- a/apps/erp/app/routes/_public+/login.tsx
+++ b/apps/erp/app/routes/_public+/login.tsx
@@ -11,7 +11,8 @@ import {
getRedirectTo,
isAuthProviderEnabled,
magicLinkValidator,
- RATE_LIMIT
+ RATE_LIMIT,
+ signInCodeValidator
} from "@carbon/auth";
import {
botProtection,
@@ -35,10 +36,18 @@ import {
getAuthSession,
setAuthSession
} from "@carbon/auth/session.server";
+import { markSignInBrowser } from "@carbon/auth/sign-in-browser.server";
import { getUserByEmail } from "@carbon/auth/users.server";
import { sendVerificationCode } from "@carbon/auth/verification.server";
import { isSsoEnabled, isSsoRequiredForEmail } from "@carbon/ee/sso.server";
-import { Hidden, Input, Submit, ValidatedForm, validator } from "@carbon/form";
+import {
+ Hidden,
+ Input,
+ InputOTP,
+ Submit,
+ ValidatedForm,
+ validator
+} from "@carbon/form";
import {
AccountLockout,
maxAttemptsForRateLimit,
@@ -251,7 +260,11 @@ export async function action({ request }: ActionFunctionArgs) {
);
}
logAuthEvent("magic_link_sent", { actor: email, ip });
- return { success: true, mode: "login" };
+ // This browser asked: the link completes here (MAGIC_LINK_SAME_BROWSER).
+ return data(
+ { success: true, mode: "login", email },
+ { headers: { "Set-Cookie": await markSignInBrowser() } }
+ );
} else if (CarbonEdition === Edition.Enterprise) {
logAuthEvent("login_failed", {
actor: email,
@@ -589,11 +602,18 @@ export default function LoginRoute() {
<Heading size="h3">
<Trans>Check your email</Trans>
</Heading>
- <p className="text-muted-foreground tracking-tight text-sm">
+ <p className="text-muted-foreground tracking-tight text-sm text-center">
<Trans>
- We've sent you a magic link to sign in to your account.
+ We've emailed you a sign-in link and a 6-digit code. Follow
+ the link, or enter the code here.
</Trans>
</p>
+ {fetcher.data.email ? (
+ <SignInCode
+ email={fetcher.data.email}
+ redirectTo={redirectTo}
+ />
+ ) : null}
</VStack>
</>
) : mode === "verify" ? (
@@ -892,3 +912,70 @@ function OutlookIcon(props: React.SVGProps<SVGSVGElement>) {
</svg>
);
}
+
+/**
+ * The code from the sign-in email, as an alternative to its link. It is
+ * the link's own one-time token: a mail scanner that only opens the link
+ * leaves it usable, one that presses the link page's button spends both
+ * (MAGIC_LINK_SAME_BROWSER hides that button from it). A verified code
+ * yields the same session the link's redirect does, handed to /callback the
+ * same way, so everything after — company, SSO, MFA — is one path for both.
+ */
+function SignInCode({
+ email,
+ redirectTo
+}: {
+ email: string;
+ redirectTo?: string;
+}) {
+ const { t } = useLingui();
+ const code = useFetcher<
+ Result & { refreshToken?: string; userId?: string }
+ >();
+ const callback = useFetcher();
+ const signingIn = callback.state !== "idle";
+
+ useEffect(() => {
+ const { refreshToken, userId } = code.data ?? {};
+ if (!code.data?.success || !refreshToken || !userId) return;
+ const formData = new FormData();
+ formData.append("refreshToken", refreshToken);
+ formData.append("userId", userId);
+ if (redirectTo) formData.append("redirectTo", redirectTo);
+ callback.submit(formData, { method: "post", action: path.to.callback });
+ }, [code.data, redirectTo, callback.submit]);
+
+ return (
+ <ValidatedForm
+ fetcher={code}
+ validator={signInCodeValidator}
+ defaultValues={{ email }}
+ method="post"
+ action={path.to.api.loginVerifyCode}
+ className="w-full"
+ >
+ <Hidden name="email" value={email} />
+ <VStack spacing={3} className="items-center">
+ {code.data?.success === false && code.data.message ? (
+ <Alert variant="destructive">
+ <LuCircleAlert className="w-4 h-4" />
+ <AlertTitle>
+ <Trans>Authentication Error</Trans>
+ </AlertTitle>
+ <AlertDescription>{code.data.message}</AlertDescription>
+ </Alert>
+ ) : null}
+ <InputOTP name="code" label={t`Sign-in code`} autoFocus />
+ <Submit
+ isDisabled={code.state !== "idle" || signingIn}
+ isLoading={code.state !== "idle" || signingIn}
+ hideShortcutKey
+ size="lg"
+ className="w-full"
+ >
+ <Trans>Sign in with code</Trans>
+ </Submit>
+ </VStack>
+ </ValidatedForm>
+ );
+}
diff --git a/apps/erp/app/routes/_public+/magic-link.tsx b/apps/erp/app/routes/_public+/magic-link.tsx
index 97e6a24f4b..644c5b7de2 100644
--- a/apps/erp/app/routes/_public+/magic-link.tsx
+++ b/apps/erp/app/routes/_public+/magic-link.tsx
@@ -2,13 +2,38 @@
// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
// including ports, remain AGPLv3; serving them over a network requires releasing their source.
-import { CONTROLLED_ENVIRONMENT, SUPABASE_URL } from "@carbon/auth";
+import {
+ CONTROLLED_ENVIRONMENT,
+ MAGIC_LINK_SAME_BROWSER,
+ SUPABASE_URL
+} from "@carbon/auth";
+import { isSignInBrowser } from "@carbon/auth/sign-in-browser.server";
import { Button, Heading } from "@carbon/react";
import { Trans, useLingui } from "@lingui/react/macro";
-import { useNavigate, useSearchParams } from "react-router";
+import type { LoaderFunctionArgs } from "react-router";
+import {
+ Link,
+ useLoaderData,
+ useNavigate,
+ useSearchParams
+} from "react-router";
+
+/**
+ * Whether this page may offer to spend the link's token. With
+ * MAGIC_LINK_SAME_BROWSER, only in the browser that asked for the email:
+ * mail security sandboxes (Microsoft Defender) open the link in a real
+ * browser and press its button, and the person then finds it used. Nothing
+ * here spends anything — the token is only used by the button.
+ */
+export async function loader({ request }: LoaderFunctionArgs) {
+ return {
+ sameBrowser: !MAGIC_LINK_SAME_BROWSER || (await isSignInBrowser(request))
+ };
+}
export default function ConfirmMagicLink() {
const { t } = useLingui();
+ const { sameBrowser } = useLoaderData<typeof loader>();
const [params] = useSearchParams();
const navigate = useNavigate();
@@ -41,19 +66,42 @@ export default function ConfirmMagicLink() {
<Heading size="h3" className="tracking-tight">
<Trans>Sign in to Carbon</Trans>
</Heading>
- <p className="mt-2 text-muted-foreground tracking-tight text-sm text-balance">
- <Trans>You're one step away from your workspace.</Trans>
- </p>
- <Button
- size="lg"
- className="w-full mt-6"
- autoFocus
- onClick={() => {
- window.location.href = getConfirmationURL(token);
- }}
- >
- <Trans>Let's Build</Trans>
- </Button>
+ {sameBrowser ? (
+ <>
+ <p className="mt-2 text-muted-foreground tracking-tight text-sm text-balance">
+ <Trans>You're one step away from your workspace.</Trans>
+ </p>
+ <Button
+ size="lg"
+ className="w-full mt-6"
+ autoFocus
+ onClick={() => {
+ window.location.href = getConfirmationURL(token);
+ }}
+ >
+ <Trans>Let's Build</Trans>
+ </Button>
+ </>
+ ) : (
+ <>
+ <p className="mt-2 text-muted-foreground tracking-tight text-sm text-balance">
+ <Trans>
+ Open this link in the browser where you asked to sign in, or
+ enter the 6-digit code from the email there.
+ </Trans>
+ </p>
+ <Button
+ size="lg"
+ variant="secondary"
+ className="w-full mt-6"
+ asChild
+ >
+ <Link to="/login">
+ <Trans>Sign in here instead</Trans>
+ </Link>
+ </Button>
+ </>
+ )}
</div>
</div>
</>
diff --git a/apps/erp/app/routes/api+/login.verify-code.test.ts b/apps/erp/app/routes/api+/login.verify-code.test.ts
new file mode 100644
index 0000000000..3e09b7956c
--- /dev/null
+++ b/apps/erp/app/routes/api+/login.verify-code.test.ts
@@ -0,0 +1,138 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { AuthApiError, AuthRetryableFetchError } from "@supabase/supabase-js";
+import type { ActionFunctionArgs } from "react-router";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+
+const calls = vi.hoisted(() => [] as string[]);
+const lockouts = vi.hoisted(() => [] as unknown[]);
+const ratelimits = vi.hoisted(() => [] as unknown[]);
+const recordFailure = vi.hoisted(() => vi.fn());
+const refund = vi.hoisted(() => vi.fn());
+const verifyOtp = vi.hoisted(() => vi.fn());
+
+vi.mock("@carbon/auth", () => ({
+ assertIsPost: () => undefined,
+ error: (_e: unknown, message: string) => ({ success: false, message }),
+ RATE_LIMIT: 5,
+ signInCodeValidator: {}
+}));
+vi.mock("@carbon/auth/auth.server", () => ({ logAuthEvent: () => undefined }));
+vi.mock("@carbon/auth/client.server", () => ({
+ getCarbonServiceRole: () => ({ auth: { verifyOtp } })
+}));
+vi.mock("@carbon/form", () => ({
+ validator: () => ({
+ validate: async () => ({ data: { email: "[email protected]", code: "123456" } })
+ })
+}));
+vi.mock("@carbon/kv", () => ({
+ SIGN_IN_CODE_LOCKOUT_PREFIX: "@carbon/lockout-code",
+ maxAttemptsForRateLimit: () => 5,
+ redis: {},
+ AccountLockout: class {
+ constructor(options: unknown) {
+ lockouts.push(options);
+ }
+ recordFailure = recordFailure;
+ refund = refund;
+ },
+ Ratelimit: Object.assign(
+ class {
+ constructor(options: unknown) {
+ ratelimits.push(options);
+ }
+ limit = async () => ({ success: true });
+ },
+ { slidingWindow: () => "window" }
+ )
+}));
+
+import { action } from "./login.verify-code";
+
+const post = async () => {
+ const res = (await action({
+ request: new Request("http://localhost/api/login/verify-code", {
+ method: "POST",
+ body: new FormData()
+ })
+ } as unknown as ActionFunctionArgs)) as
+ | { data: { message?: string }; init: { status: number } }
+ | { success: true };
+ return "init" in res
+ ? { status: res.init.status, message: res.data.message }
+ : { status: 200, message: undefined };
+};
+
+describe("sign-in code", () => {
+ beforeEach(() => {
+ calls.length = 0;
+ lockouts.length = 0;
+ ratelimits.length = 0;
+ recordFailure.mockReset().mockImplementation(async () => {
+ calls.push("count");
+ return { locked: false, retryAfterSeconds: 0 };
+ });
+ refund.mockReset();
+ verifyOtp.mockReset().mockImplementation(async () => {
+ calls.push("verify");
+ return {
+ data: { session: { refresh_token: "r", user: { id: "u" } } },
+ error: null
+ };
+ });
+ });
+
+ it("keeps its own lockout and IP bucket, apart from the link's", async () => {
+ await post();
+ expect(lockouts).toEqual([
+ expect.objectContaining({
+ prefix: "@carbon/lockout-code",
+ maxAttempts: 5
+ })
+ ]);
+ expect(ratelimits).toEqual([
+ expect.objectContaining({ prefix: "@carbon/ratelimit-code" })
+ ]);
+ });
+
+ it("counts the attempt before checking the code", async () => {
+ expect((await post()).status).toBe(200);
+ expect(calls).toEqual(["count", "verify"]);
+ });
+
+ it("does not check a code once the guesses run out", async () => {
+ recordFailure.mockResolvedValue({ locked: true, retryAfterSeconds: 60 });
+ expect((await post()).status).toBe(429);
+ expect(verifyOtp).not.toHaveBeenCalled();
+ });
+
+ it("calls a wrong code wrong, and keeps the attempt", async () => {
+ verifyOtp.mockResolvedValue({
+ data: { session: null },
+ error: new AuthApiError(
+ "Token has expired or is invalid",
+ 403,
+ "otp_expired"
+ )
+ });
+ const res = await post();
+ expect(res.status).toBe(400);
+ expect(res.message).toMatch(/wrong/);
+ expect(refund).not.toHaveBeenCalled();
+ });
+
+ it.each([
+ ["Auth unreachable", new AuthRetryableFetchError("fetch failed", 0)],
+ ["Auth failing", new AuthApiError("boom", 500, undefined)],
+ ["Auth throttling", new AuthApiError("slow down", 429, undefined)]
+ ])("%s: asks for a retry and gives the attempt back", async (_, err) => {
+ verifyOtp.mockResolvedValue({ data: { session: null }, error: err });
+ const res = await post();
+ expect(res.status).toBe(503);
+ expect(res.message).not.toMatch(/wrong/);
+ expect(refund).toHaveBeenCalledWith("[email protected]");
+ });
+});
diff --git a/apps/erp/app/routes/api+/login.verify-code.ts b/apps/erp/app/routes/api+/login.verify-code.ts
new file mode 100644
index 0000000000..ae88af7009
--- /dev/null
+++ b/apps/erp/app/routes/api+/login.verify-code.ts
@@ -0,0 +1,126 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import {
+ assertIsPost,
+ error,
+ RATE_LIMIT,
+ signInCodeValidator
+} from "@carbon/auth";
+import { logAuthEvent } from "@carbon/auth/auth.server";
+import { getCarbonServiceRole } from "@carbon/auth/client.server";
+import { validator } from "@carbon/form";
+import {
+ AccountLockout,
+ maxAttemptsForRateLimit,
+ Ratelimit,
+ redis,
+ SIGN_IN_CODE_LOCKOUT_PREFIX
+} from "@carbon/kv";
+import { getClientIp } from "@carbon/utils";
+import { isAuthRetryableFetchError } from "@supabase/supabase-js";
+import type { ActionFunctionArgs } from "react-router";
+import { data } from "react-router";
+
+const LOCKED_MESSAGE =
+ "For your security, sign-in for this account is temporarily paused. Please try again later.";
+const WRONG_CODE_MESSAGE =
+ "That code is wrong or has expired. Check the newest email, or request a new one.";
+const UNAVAILABLE_MESSAGE =
+ "We couldn't check your code just now. Please try again in a moment.";
+
+/**
+ * Signs in with the 6-digit code from a sign-in email, the alternative to
+ * following its link, for when the email and the sign-in are not in the same
+ * browser.
+ *
+ * The code is Auth's own one-time token, so it shares the link's lifetime and
+ * single use: whatever spends the link spends the code. A verified code answers with the session, which the browser
+ * hands to /callback exactly as the link's redirect does — company choice,
+ * SSO enforcement, MFA and the lockout reset all happen there, once, for both.
+ *
+ * Guarded like the login action, with buckets of its own: a per-IP rate limit
+ * and a per-account lockout where every code counts — six digits are
+ * otherwise a million guesses. Its own, so guessing at someone's code locks
+ * code sign-in only and never stops them asking for a link, and signing in
+ * with a code does not spend the IP's login budget. /callback resets both
+ * lockouts on success.
+ */
+export async function action({ request }: ActionFunctionArgs) {
+ assertIsPost(request);
+ const ip = getClientIp(request) ?? "127.0.0.1";
+
+ const ratelimit = new Ratelimit({
+ redis,
+ limiter: Ratelimit.slidingWindow(RATE_LIMIT, "1 h"),
+ analytics: true,
+ prefix: "@carbon/ratelimit-code"
+ });
+ if (!(await ratelimit.limit(ip)).success) {
+ logAuthEvent("login_rate_limited", { ip });
+ return data(error(null, "Rate limit exceeded"), { status: 429 });
+ }
+
+ const validation = await validator(signInCodeValidator).validate(
+ await request.formData()
+ );
+ if (validation.error) {
+ return data(error(validation.error, "Enter the 6-digit code"), {
+ status: 400
+ });
+ }
+ const { email, code } = validation.data;
+
+ const lockout = new AccountLockout({
+ redis,
+ maxAttempts: maxAttemptsForRateLimit(RATE_LIMIT),
+ prefix: SIGN_IN_CODE_LOCKOUT_PREFIX
+ });
+ // Counted before the check, so a burst of guesses cannot all slip past a
+ // read-only status check; an outage gives its attempt back below.
+ const attempt = await lockout.recordFailure(email);
+ if (attempt.locked) {
+ logAuthEvent("login_locked", {
+ actor: email,
+ ip,
+ reason: "sign-in code temporarily locked",
+ retryAfterSeconds: attempt.retryAfterSeconds
+ });
+ return data(error(null, LOCKED_MESSAGE), { status: 429 });
+ }
+
+ const { data: verified, error: verifyError } =
+ await getCarbonServiceRole().auth.verifyOtp({
+ email,
+ token: code,
+ type: "email"
+ });
+
+ // Auth down or throttling: the code was never checked, so it is neither
+ // wrong nor a guess.
+ if (
+ verifyError &&
+ (isAuthRetryableFetchError(verifyError) ||
+ (verifyError.status ?? 0) >= 500 ||
+ verifyError.status === 429)
+ ) {
+ await lockout.refund(email);
+ return data(error(verifyError, UNAVAILABLE_MESSAGE), { status: 503 });
+ }
+
+ if (verifyError || !verified.session) {
+ logAuthEvent("login_failed", {
+ actor: email,
+ ip,
+ reason: "sign-in code rejected"
+ });
+ return data(error(verifyError, WRONG_CODE_MESSAGE), { status: 400 });
+ }
+
+ return {
+ success: true,
+ refreshToken: verified.session.refresh_token,
+ userId: verified.session.user.id
+ };
+}
diff --git a/apps/erp/app/routes/templates.$file.test.ts b/apps/erp/app/routes/templates.$file.test.ts
new file mode 100644
index 0000000000..30ad55071c
--- /dev/null
+++ b/apps/erp/app/routes/templates.$file.test.ts
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import type { LoaderFunctionArgs } from "react-router";
+import { describe, expect, it } from "vitest";
+import { loader } from "./templates.$file";
+
+const get = (file: string) =>
+ loader({ params: { file } } as unknown as LoaderFunctionArgs);
+
+describe("Auth email templates", () => {
+ it("serves each as HTML with Auth's placeholders for Auth to fill", async () => {
+ const res = await get("magic-link.html");
+ expect(res.status).toBe(200);
+ expect(res.headers.get("Content-Type")).toContain("text/html");
+ const html = await res.text();
+ expect(html).toContain("{{ .Token }}");
+ expect(html).toContain("{{ .SiteURL }}/magic-link?token={{ .TokenHash }}");
+ });
+
+ it("is a 404 for anything else, which Auth treats as no template", async () => {
+ expect((await get("nope.html")).status).toBe(404);
+ expect((await get("../package.json")).status).toBe(404);
+ expect((await get("constructor")).status).toBe(404);
+ });
+});
diff --git a/apps/erp/app/routes/templates.$file.ts b/apps/erp/app/routes/templates.$file.ts
new file mode 100644
index 0000000000..f7b4e79ed9
--- /dev/null
+++ b/apps/erp/app/routes/templates.$file.ts
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { authEmails } from "@carbon/documents/email";
+import { renderAsync } from "@react-email/components";
+import { createElement } from "react";
+import type { LoaderFunctionArgs } from "react-router";
+
+/**
+ * Auth's email templates, rendered from Carbon's React Email components
+ * with Auth's placeholders left for Auth to fill in. Self-hosted Auth
+ * downloads these when it sends mail (GOTRUE_MAILER_TEMPLATES_*, pointed
+ * at the ERP inside the cluster), so every deployment's emails match its
+ * own release. Public: a template is the same for everyone and carries no
+ * data.
+ */
+export async function loader({ params }: LoaderFunctionArgs) {
+ const file = params.file ?? "";
+ // Own keys only: "constructor" would otherwise find Object's.
+ if (!Object.hasOwn(authEmails, file)) {
+ return new Response("Not found", { status: 404 });
+ }
+ const Email = authEmails[file as keyof typeof authEmails];
+ const html = await renderAsync(createElement(Email));
+ return new Response(html, {
+ headers: {
+ "Content-Type": "text/html; charset=utf-8",
+ // Auth keeps its own copy for minutes; this only spares re-renders.
+ "Cache-Control": "public, max-age=300"
+ }
+ });
+}
diff --git a/apps/erp/app/utils/path.ts b/apps/erp/app/utils/path.ts
index b3a3149b86..d515560b3d 100644
--- a/apps/erp/app/utils/path.ts
+++ b/apps/erp/app/utils/path.ts
@@ -216,6 +216,7 @@ export const path = {
locationEmployees: (locationId: string) =>
generatePath(`${api}/people/employees/${locationId}`),
locations: `${api}/resources/locations`,
+ loginVerifyCode: `${api}/login/verify-code`,
maintenanceDispatches: `${api}/resources/maintenance`,
maintenanceSchedules: `${api}/resources/scheduled-maintenance`,
materialDimensions: (formId: string) =>
@@ -518,6 +519,7 @@ export const path = {
bulkUpdateSupplierQuote: `${x}/supplier-quote/update`,
bulkUpdateTraining: `${x}/training/update`,
calibrations: `${x}/quality/calibrations`,
+ callback: "/callback",
cancelPurchasingRfq: (id: string) =>
generatePath(`${x}/purchasing-rfq/${id}/cancel`),
// The `?app=` hint lets the docs' Subscribe popover link to this instance.
diff --git a/apps/erp/public/templates/invite.html b/apps/erp/public/templates/invite.html
deleted file mode 100644
index 5ef340ac99..0000000000
--- a/apps/erp/public/templates/invite.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<h2>You have been invited to Carbon</h2>
-
-<p>
- You have been invited to create a user on Carbon. Follow this link to accept
- the invite:
-</p>
-
-<p>
- <a href="{{ .SiteURL }}/confirm-invite?token={{ .TokenHash }}"
- >Accept the invite</a
- >
-</p>
diff --git a/apps/erp/public/templates/magic-link.html b/apps/erp/public/templates/magic-link.html
deleted file mode 100644
index 43c107dd4e..0000000000
--- a/apps/erp/public/templates/magic-link.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<h2>Magic Link for Carbon</h2>
-
-<p>Follow this link to login:</p>
-
-<p>
- <a href="{{ .SiteURL }}/magic-link?token={{ .TokenHash }}">Log In</a>
-</p>
diff --git a/apps/mes/app/routes/_public+/callback.tsx b/apps/mes/app/routes/_public+/callback.tsx
index 2500048eef..dcaa7affe1 100644
--- a/apps/mes/app/routes/_public+/callback.tsx
+++ b/apps/mes/app/routes/_public+/callback.tsx
@@ -31,7 +31,7 @@ import {
isSsoRequiredForEmail
} from "@carbon/ee/sso.server";
import { validator } from "@carbon/form";
-import { AccountLockout, redis } from "@carbon/kv";
+import { AccountLockout, redis, SIGN_IN_CODE_LOCKOUT_PREFIX } from "@carbon/kv";
import { getLogger } from "@carbon/logger";
import {
Alert,
@@ -191,6 +191,10 @@ export async function action({ request }: ActionFunctionArgs) {
authSession.ssoProviderId = ssoProviderId;
await new AccountLockout({ redis }).reset(authSession.email);
+ await new AccountLockout({
+ redis,
+ prefix: SIGN_IN_CODE_LOCKOUT_PREFIX
+ }).reset(authSession.email);
// The IdP owns MFA for SSO sessions, including controlled environments
// (user decision — attestation shifts to the IdP policy).
@@ -262,6 +266,10 @@ export async function action({ request }: ActionFunctionArgs) {
// accumulated per-account lockout state (NIST 3.1.8 reset-on-success). Runs
// before the TOTP gate so an MFA-enrolled user's counter clears too.
await new AccountLockout({ redis }).reset(authSession.email);
+ await new AccountLockout({
+ redis,
+ prefix: SIGN_IN_CODE_LOCKOUT_PREFIX
+ }).reset(authSession.email);
// TOTP gate: park the tokens in the pending-MFA key and challenge before
// any full session cookie exists. The /mfa action mints the real session.
diff --git a/apps/mes/app/routes/_public+/login.tsx b/apps/mes/app/routes/_public+/login.tsx
index 03699149f2..daab37d550 100644
--- a/apps/mes/app/routes/_public+/login.tsx
+++ b/apps/mes/app/routes/_public+/login.tsx
@@ -12,7 +12,8 @@ import {
getRedirectTo,
isAuthProviderEnabled,
magicLinkValidator,
- RATE_LIMIT
+ RATE_LIMIT,
+ signInCodeValidator
} from "@carbon/auth";
import {
botProtection,
@@ -30,9 +31,17 @@ import {
getAuthSession,
setAuthSession
} from "@carbon/auth/session.server";
+import { markSignInBrowser } from "@carbon/auth/sign-in-browser.server";
import { getUserByEmail } from "@carbon/auth/users.server";
import { isSsoEnabled, isSsoRequiredForEmail } from "@carbon/ee/sso.server";
-import { Hidden, Input, Submit, ValidatedForm, validator } from "@carbon/form";
+import {
+ Hidden,
+ Input,
+ InputOTP,
+ Submit,
+ ValidatedForm,
+ validator
+} from "@carbon/form";
import {
AccountLockout,
maxAttemptsForRateLimit,
@@ -243,7 +252,11 @@ export async function action({ request }: ActionFunctionArgs) {
);
}
- return { success: true };
+ // This browser asked: the link completes here (MAGIC_LINK_SAME_BROWSER).
+ return data(
+ { success: true, email },
+ { headers: { "Set-Cookie": await markSignInBrowser() } }
+ );
}
export default function LoginRoute() {
@@ -271,7 +284,7 @@ export default function LoginRoute() {
const emailParam = searchParams.get("email") ?? undefined;
const fetcher = useFetcher<
- { success: true } | { success: false; message: string }
+ { success: true; email?: string } | { success: false; message: string }
>();
const bot = useBotProtection("/login", botProtection, fetcher.data);
@@ -503,11 +516,18 @@ export default function LoginRoute() {
<Heading size="h3">
<Trans>Check your email</Trans>
</Heading>
- <p className="text-muted-foreground tracking-tight text-sm">
+ <p className="text-muted-foreground tracking-tight text-sm text-center">
<Trans>
- We've sent you a magic link to sign in to your account.
+ We've emailed you a sign-in link and a 6-digit code. Follow
+ the link, or enter the code here.
</Trans>
</p>
+ {fetcher.data.email ? (
+ <SignInCode
+ email={fetcher.data.email}
+ redirectTo={redirectTo}
+ />
+ ) : null}
</VStack>
</>
) : (
@@ -775,3 +795,73 @@ function OutlookIcon(props: React.SVGProps<SVGSVGElement>) {
</svg>
);
}
+
+/**
+ * The code from the sign-in email, as an alternative to its link. It is
+ * the link's own one-time token: a mail scanner that only opens the link
+ * leaves it usable, one that presses the link page's button spends both
+ * (MAGIC_LINK_SAME_BROWSER hides that button from it). A verified code
+ * yields the same session the link's redirect does, handed to /callback the
+ * same way, so everything after — company, SSO, MFA — is one path for both.
+ */
+function SignInCode({
+ email,
+ redirectTo
+}: {
+ email: string;
+ redirectTo?: string;
+}) {
+ const { t } = useLingui();
+ const code = useFetcher<{
+ success: boolean;
+ message?: string;
+ refreshToken?: string;
+ userId?: string;
+ }>();
+ const callback = useFetcher();
+ const signingIn = callback.state !== "idle";
+
+ useEffect(() => {
+ const { refreshToken, userId } = code.data ?? {};
+ if (!code.data?.success || !refreshToken || !userId) return;
+ const formData = new FormData();
+ formData.append("refreshToken", refreshToken);
+ formData.append("userId", userId);
+ if (redirectTo) formData.append("redirectTo", redirectTo);
+ callback.submit(formData, { method: "post", action: path.to.callback });
+ }, [code.data, redirectTo, callback.submit]);
+
+ return (
+ <ValidatedForm
+ fetcher={code}
+ validator={signInCodeValidator}
+ defaultValues={{ email }}
+ method="post"
+ action={path.to.api.loginVerifyCode}
+ className="w-full"
+ >
+ <Hidden name="email" value={email} />
+ <VStack spacing={3} className="items-center">
+ {code.data?.success === false && code.data.message ? (
+ <Alert variant="destructive">
+ <LuCircleAlert className="w-4 h-4" />
+ <AlertTitle>
+ <Trans>Authentication Error</Trans>
+ </AlertTitle>
+ <AlertDescription>{code.data.message}</AlertDescription>
+ </Alert>
+ ) : null}
+ <InputOTP name="code" label={t`Sign-in code`} autoFocus />
+ <Submit
+ isDisabled={code.state !== "idle" || signingIn}
+ isLoading={code.state !== "idle" || signingIn}
+ hideShortcutKey
+ size="lg"
+ className="w-full"
+ >
+ <Trans>Sign in with code</Trans>
+ </Submit>
+ </VStack>
+ </ValidatedForm>
+ );
+}
diff --git a/apps/mes/app/routes/api+/login.verify-code.ts b/apps/mes/app/routes/api+/login.verify-code.ts
new file mode 100644
index 0000000000..ae88af7009
--- /dev/null
+++ b/apps/mes/app/routes/api+/login.verify-code.ts
@@ -0,0 +1,126 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import {
+ assertIsPost,
+ error,
+ RATE_LIMIT,
+ signInCodeValidator
+} from "@carbon/auth";
+import { logAuthEvent } from "@carbon/auth/auth.server";
+import { getCarbonServiceRole } from "@carbon/auth/client.server";
+import { validator } from "@carbon/form";
+import {
+ AccountLockout,
+ maxAttemptsForRateLimit,
+ Ratelimit,
+ redis,
+ SIGN_IN_CODE_LOCKOUT_PREFIX
+} from "@carbon/kv";
+import { getClientIp } from "@carbon/utils";
+import { isAuthRetryableFetchError } from "@supabase/supabase-js";
+import type { ActionFunctionArgs } from "react-router";
+import { data } from "react-router";
+
+const LOCKED_MESSAGE =
+ "For your security, sign-in for this account is temporarily paused. Please try again later.";
+const WRONG_CODE_MESSAGE =
+ "That code is wrong or has expired. Check the newest email, or request a new one.";
+const UNAVAILABLE_MESSAGE =
+ "We couldn't check your code just now. Please try again in a moment.";
+
+/**
+ * Signs in with the 6-digit code from a sign-in email, the alternative to
+ * following its link, for when the email and the sign-in are not in the same
+ * browser.
+ *
+ * The code is Auth's own one-time token, so it shares the link's lifetime and
+ * single use: whatever spends the link spends the code. A verified code answers with the session, which the browser
+ * hands to /callback exactly as the link's redirect does — company choice,
+ * SSO enforcement, MFA and the lockout reset all happen there, once, for both.
+ *
+ * Guarded like the login action, with buckets of its own: a per-IP rate limit
+ * and a per-account lockout where every code counts — six digits are
+ * otherwise a million guesses. Its own, so guessing at someone's code locks
+ * code sign-in only and never stops them asking for a link, and signing in
+ * with a code does not spend the IP's login budget. /callback resets both
+ * lockouts on success.
+ */
+export async function action({ request }: ActionFunctionArgs) {
+ assertIsPost(request);
+ const ip = getClientIp(request) ?? "127.0.0.1";
+
+ const ratelimit = new Ratelimit({
+ redis,
+ limiter: Ratelimit.slidingWindow(RATE_LIMIT, "1 h"),
+ analytics: true,
+ prefix: "@carbon/ratelimit-code"
+ });
+ if (!(await ratelimit.limit(ip)).success) {
+ logAuthEvent("login_rate_limited", { ip });
+ return data(error(null, "Rate limit exceeded"), { status: 429 });
+ }
+
+ const validation = await validator(signInCodeValidator).validate(
+ await request.formData()
+ );
+ if (validation.error) {
+ return data(error(validation.error, "Enter the 6-digit code"), {
+ status: 400
+ });
+ }
+ const { email, code } = validation.data;
+
+ const lockout = new AccountLockout({
+ redis,
+ maxAttempts: maxAttemptsForRateLimit(RATE_LIMIT),
+ prefix: SIGN_IN_CODE_LOCKOUT_PREFIX
+ });
+ // Counted before the check, so a burst of guesses cannot all slip past a
+ // read-only status check; an outage gives its attempt back below.
+ const attempt = await lockout.recordFailure(email);
+ if (attempt.locked) {
+ logAuthEvent("login_locked", {
+ actor: email,
+ ip,
+ reason: "sign-in code temporarily locked",
+ retryAfterSeconds: attempt.retryAfterSeconds
+ });
+ return data(error(null, LOCKED_MESSAGE), { status: 429 });
+ }
+
+ const { data: verified, error: verifyError } =
+ await getCarbonServiceRole().auth.verifyOtp({
+ email,
+ token: code,
+ type: "email"
+ });
+
+ // Auth down or throttling: the code was never checked, so it is neither
+ // wrong nor a guess.
+ if (
+ verifyError &&
+ (isAuthRetryableFetchError(verifyError) ||
+ (verifyError.status ?? 0) >= 500 ||
+ verifyError.status === 429)
+ ) {
+ await lockout.refund(email);
+ return data(error(verifyError, UNAVAILABLE_MESSAGE), { status: 503 });
+ }
+
+ if (verifyError || !verified.session) {
+ logAuthEvent("login_failed", {
+ actor: email,
+ ip,
+ reason: "sign-in code rejected"
+ });
+ return data(error(verifyError, WRONG_CODE_MESSAGE), { status: 400 });
+ }
+
+ return {
+ success: true,
+ refreshToken: verified.session.refresh_token,
+ userId: verified.session.user.id
+ };
+}
diff --git a/apps/mes/app/utils/path.ts b/apps/mes/app/utils/path.ts
index 17060b46ef..2d2098753e 100644
--- a/apps/mes/app/utils/path.ts
+++ b/apps/mes/app/utils/path.ts
@@ -26,6 +26,7 @@ export const path = {
batchNumbers: (itemId: string) =>
generatePath(`${api}/batch-numbers?itemId=${itemId}`),
failureModes: `${api}/failure-modes`,
+ loginVerifyCode: `${api}/login/verify-code`,
modelArtifacts: (modelUploadId: string) =>
generatePath(`${api}/model/artifacts/${modelUploadId}`),
modelDownload: (modelUploadId: string) =>
diff --git a/packages/auth/AGENTS.md b/packages/auth/AGENTS.md
index 8438f24918..24134ba2d7 100644
--- a/packages/auth/AGENTS.md
+++ b/packages/auth/AGENTS.md
@@ -49,7 +49,7 @@ pnpm --filter @carbon/auth test
| `./console-pin.server` | MES console pin-in cookie (signed, bound to company + terminal session user): `setConsolePinIn`, `clearConsolePinIn`, `resolveConsolePinIn` (re-validated against the DB, memoized per read), `ConsolePinIn`; `requirePermissions` uses it to derive `userId` in console mode |
| `./self-signup.server` | Cloud self-signup blocklist: `isSelfSignupBlockedForEmail`, `SELF_SIGNUP_BLOCKED_MESSAGE` (free/disposable email domains; used by ERP login/verify/callback + MES callback) |
| `./middleware/flash.server` | Flash message middleware |
-| `./middleware/maintenance.server` | `maintenanceMiddleware` (with `MAINTENANCE_MODE` on: 503 for every request, 200 for `/health`); keep it after `securityMiddleware` in each root `middleware`. The decision is the pure `maintenanceVerdict` |
+| `./middleware/maintenance.server` | `maintenanceMiddleware` (with `MAINTENANCE_MODE` on: 503 for every request, 200 for `/health`, `/templates/` passes through); keep it after `securityMiddleware` in each root `middleware`. The decision is the pure `maintenanceVerdict` |
| `./middleware/security.server` | `securityMiddleware` (CSRF check + CSP nonce + baseline headers), `rejectCrossSiteNavigation`, `getNonce`, `setStrictContentSecurityPolicy` (report-only for now; `entry.server` calls it), `cspReportAction` + `CSP_REPORT_PATH`. The decisions are pure and tested in `lib/security.ts` |
SAML SSO lives in `@carbon/ee/sso.server` (Enterprise-gated), NOT here — auth
diff --git a/packages/auth/package.json b/packages/auth/package.json
index 774cdb7866..ccd76fd308 100644
--- a/packages/auth/package.json
+++ b/packages/auth/package.json
@@ -18,6 +18,7 @@
"./download-token.server": "./src/lib/download-token.server.ts",
"./erp-proxy.server": "./src/services/erp-proxy.server.ts",
"./oauth-state.server": "./src/lib/oauth-state.server.ts",
+ "./sign-in-browser.server": "./src/lib/sign-in-browser.server.ts",
"./company.server": "./src/services/company.server.ts",
"./console-pin.server": "./src/services/console-pin.server.ts",
"./mfa.server": "./src/services/mfa.server.ts",
diff --git a/packages/auth/src/lib/sign-in-browser.server.test.ts b/packages/auth/src/lib/sign-in-browser.server.test.ts
new file mode 100644
index 0000000000..dd54144775
--- /dev/null
+++ b/packages/auth/src/lib/sign-in-browser.server.test.ts
@@ -0,0 +1,60 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { afterEach, describe, expect, it, vi } from "vitest";
+
+vi.mock("../config/env", () => ({
+ AUTH_COOKIE_SUFFIX: undefined,
+ CarbonEdition: "Community",
+ DOMAIN: "localhost",
+ SESSION_SECRET: "test-session-secret"
+}));
+
+import { isSignInBrowser, markSignInBrowser } from "./sign-in-browser.server";
+
+const requestWith = (cookie?: string) =>
+ new Request("http://localhost/magic-link?token=x", {
+ headers: cookie ? { Cookie: cookie } : {}
+ });
+
+describe("sign-in browser", () => {
+ afterEach(() => vi.useRealTimers());
+
+ it("is the browser that asked, for the link's hour, and no other", async () => {
+ const cookie = (await markSignInBrowser()).split(";")[0]!;
+ expect(await isSignInBrowser(requestWith(cookie))).toBe(true);
+ // A mail sandbox opening the link: no cookie.
+ expect(await isSignInBrowser(requestWith())).toBe(false);
+ // A cookie that was not signed with the secret.
+ expect(await isSignInBrowser(requestWith("carbon-sign-in=e30%3D"))).toBe(
+ false
+ );
+ });
+
+ it("stops once the link has expired", async () => {
+ const cookie = (await markSignInBrowser()).split(";")[0]!;
+ vi.useFakeTimers({ now: Date.now() + 61 * 60 * 1000 });
+ expect(await isSignInBrowser(requestWith(cookie))).toBe(false);
+ });
+});
+
+describe("sign-in browser without a shared DOMAIN", () => {
+ it("binds nothing, so an MES link still completes on the ERP", async () => {
+ vi.resetModules();
+ vi.doMock("../config/env", () => ({
+ AUTH_COOKIE_SUFFIX: undefined,
+ CarbonEdition: "Community",
+ DOMAIN: undefined,
+ SESSION_SECRET: "test-session-secret"
+ }));
+ const warn = vi.fn();
+ vi.doMock("@carbon/logger", () => ({ getLogger: () => ({ warn }) }));
+ const unbound = await import("./sign-in-browser.server");
+ expect(await unbound.isSignInBrowser(requestWith())).toBe(true);
+ expect(await unbound.isSignInBrowser(requestWith())).toBe(true);
+ expect(warn).toHaveBeenCalledTimes(1);
+ vi.doUnmock("../config/env");
+ vi.doUnmock("@carbon/logger");
+ });
+});
diff --git a/packages/auth/src/lib/sign-in-browser.server.ts b/packages/auth/src/lib/sign-in-browser.server.ts
new file mode 100644
index 0000000000..ddbd1bdc57
--- /dev/null
+++ b/packages/auth/src/lib/sign-in-browser.server.ts
@@ -0,0 +1,63 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { getLogger } from "@carbon/logger";
+import { Edition } from "@carbon/utils";
+import { createCookie } from "react-router";
+import { CarbonEdition, DOMAIN, SESSION_SECRET } from "../config/env";
+import { authCookieName, getCookieDomain } from "../utils/cookie";
+
+/**
+ * Marks the browser that asked for a sign-in email, so the link in it can
+ * refuse to complete anywhere else (MAGIC_LINK_SAME_BROWSER). A mail
+ * security sandbox opening the link has no such cookie, so it is shown a
+ * page with nothing to press and the one-time token survives for the
+ * person. On the shared DOMAIN, like the session, so a link the MES asked
+ * for opens on the ERP's /magic-link page in the same browser.
+ *
+ * As long as the link lives (GoTrue's one hour), and carrying nothing but
+ * when: it proves "this browser asked", not who for.
+ *
+ * Without DOMAIN the cookie is host-only, and a link the MES asked for could
+ * never complete on the ERP's host. The flag must never make sign-in
+ * impossible, so then every browser counts as the one that asked.
+ */
+const MAX_AGE_SECONDS = 60 * 60;
+
+const isTestEdition = CarbonEdition === Edition.Test;
+const cookieDomain = isTestEdition ? undefined : getCookieDomain(DOMAIN);
+
+const signInBrowserCookie = createCookie(authCookieName("carbon-sign-in"), {
+ httpOnly: true,
+ path: "/",
+ sameSite: isTestEdition ? "none" : "lax",
+ secrets: [SESSION_SECRET!],
+ secure: isTestEdition || !!cookieDomain,
+ domain: cookieDomain,
+ maxAge: MAX_AGE_SECONDS
+});
+
+/** The Set-Cookie for a browser that just asked for a sign-in email. */
+export function markSignInBrowser(): Promise<string> {
+ return signInBrowserCookie.serialize({ at: Date.now() });
+}
+
+const log = getLogger("auth", "sign-in-browser");
+let warnedUnbound = false;
+
+/** Whether this browser asked for a sign-in email within the link's life. */
+export async function isSignInBrowser(request: Request): Promise<boolean> {
+ if (!DOMAIN) {
+ if (!warnedUnbound) {
+ warnedUnbound = true;
+ log.warn(
+ "MAGIC_LINK_SAME_BROWSER is on but DOMAIN is unset: the ERP and MES share no cookie, so sign-in links are not bound to the browser that asked."
+ );
+ }
+ return true;
+ }
+ const value = await signInBrowserCookie.parse(request.headers.get("Cookie"));
+ const at = typeof value?.at === "number" ? value.at : 0;
+ return Date.now() - at < MAX_AGE_SECONDS * 1000;
+}
diff --git a/packages/auth/src/middleware/maintenance.server.test.ts b/packages/auth/src/middleware/maintenance.server.test.ts
index cd2b36e921..6c63cf30c5 100644
--- a/packages/auth/src/middleware/maintenance.server.test.ts
+++ b/packages/auth/src/middleware/maintenance.server.test.ts
@@ -15,6 +15,10 @@ describe("maintenanceVerdict", () => {
expect(maintenanceVerdict(true, "/health")).toBe("healthy");
});
+ it("keeps serving Auth's email templates during maintenance", () => {
+ expect(maintenanceVerdict(true, "/templates/magic-link.html")).toBeNull();
+ });
+
it("refuses pages, the API, webhooks and job callbacks", () => {
for (const pathname of [
"/",
diff --git a/packages/auth/src/middleware/maintenance.server.ts b/packages/auth/src/middleware/maintenance.server.ts
index b43b880a92..72cf89b5af 100644
--- a/packages/auth/src/middleware/maintenance.server.ts
+++ b/packages/auth/src/middleware/maintenance.server.ts
@@ -14,12 +14,16 @@ const RETRY_AFTER_SECONDS = "300";
* `/health` answers 200 without probing anything. The load balancer and the
* Swarm healthcheck replace a task that fails it, and the usual probe fails
* while the database is down for the maintenance itself.
+ *
+ * `/templates/` goes through: Auth downloads its email templates from there
+ * when it sends mail, and they read no data, so a sign-in email sent during
+ * maintenance still uses Carbon's template.
*/
export function maintenanceVerdict(
enabled: boolean,
pathname: string
): null | "healthy" | "refuse" {
- if (!enabled) return null;
+ if (!enabled || pathname.startsWith("/templates/")) return null;
return pathname === "/health" ? "healthy" : "refuse";
}
diff --git a/packages/auth/src/validators.test.ts b/packages/auth/src/validators.test.ts
new file mode 100644
index 0000000000..112b5b2630
--- /dev/null
+++ b/packages/auth/src/validators.test.ts
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { describe, expect, it } from "vitest";
+import { signInCodeValidator } from "./validators";
+
+describe("signInCodeValidator", () => {
+ it("takes an email and the six digits from the sign-in email", () => {
+ expect(
+ signInCodeValidator.safeParse({ email: "[email protected]", code: "042913" }).success
+ ).toBe(true);
+ });
+
+ it("refuses anything but exactly six digits, before Auth is asked", () => {
+ for (const code of ["", "12345", "1234567", "12345a", " 123456"]) {
+ expect(
+ signInCodeValidator.safeParse({ email: "[email protected]", code }).success
+ ).toBe(false);
+ }
+ expect(
+ signInCodeValidator.safeParse({ email: "not-an-email", code: "123456" })
+ .success
+ ).toBe(false);
+ });
+});
diff --git a/packages/auth/src/validators.ts b/packages/auth/src/validators.ts
index 77bbf32f0b..366a6b4565 100644
--- a/packages/auth/src/validators.ts
+++ b/packages/auth/src/validators.ts
@@ -38,6 +38,16 @@ export const magicLinkValidator = z.object({
botToken: zfd.text(z.string().optional())
});
+// The 6-digit code a sign-in email carries beside its link (Auth's
+// {{ .Token }}): the same one-time token, typed instead of followed.
+export const signInCodeValidator = z.object({
+ email: z
+ .string()
+ .min(1, { message: "Email is required" })
+ .email("Must be a valid email"),
+ code: z.string().regex(/^\d{6}$/, { message: "Enter the 6-digit code" })
+});
+
export const passwordLoginValidator = z.object({
email: z
.string()
diff --git a/packages/database/supabase/config.toml b/packages/database/supabase/config.toml
index 0a2652b451..73cdec2971 100644
--- a/packages/database/supabase/config.toml
+++ b/packages/database/supabase/config.toml
@@ -112,7 +112,7 @@ subject = "You have been invited to Carbon"
content_path = "./supabase/templates/invite.html"
[auth.email.template.magic_link]
-subject = "Your Carbon Magic Link"
+subject = "Your Carbon sign-in code"
content_path = "./supabase/templates/magic-link.html"
diff --git a/packages/database/supabase/templates/magic-link.html b/packages/database/supabase/templates/magic-link.html
index 43c107dd4e..64d2f13469 100644
--- a/packages/database/supabase/templates/magic-link.html
+++ b/packages/database/supabase/templates/magic-link.html
@@ -1,7 +1,13 @@
-<h2>Magic Link for Carbon</h2>
+<h2>Sign in to Carbon</h2>
-<p>Follow this link to login:</p>
+<p>Enter this code on the sign-in screen:</p>
+
+<p style="font-family: monospace; font-size: 28px; font-weight: 600; letter-spacing: 6px">{{ .Token }}</p>
+
+<p>Or follow this link:</p>
<p>
<a href="{{ .SiteURL }}/magic-link?token={{ .TokenHash }}">Log In</a>
</p>
+
+<p>The code and the link are the same sign-in: use either, once.</p>
diff --git a/packages/documents/src/email/auth/AuthEmail.tsx b/packages/documents/src/email/auth/AuthEmail.tsx
new file mode 100644
index 0000000000..8ba061294b
--- /dev/null
+++ b/packages/documents/src/email/auth/AuthEmail.tsx
@@ -0,0 +1,177 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import {
+ Body,
+ Button,
+ Container,
+ Heading,
+ Hr,
+ Link,
+ Preview,
+ Section,
+ Text
+} from "@react-email/components";
+import { Logo } from "../components/Logo";
+import { notificationStyles } from "../components/notificationStyles";
+import { EmailThemeProvider, getEmailThemeClasses } from "../components/Theme";
+
+/**
+ * The emails Auth (GoTrue) sends — sign-in, invite, confirmation, password
+ * reset, email change — on Carbon's notification card.
+ *
+ * Auth fills these in itself: the ERP serves them rendered with Auth's Go
+ * template placeholders left as text ({{ .Token }}, {{ .SiteURL }}…), and
+ * Auth downloads them when it sends mail (routes/templates.$file.ts). Each
+ * placeholder is one string literal: a JSX expression beside other text
+ * would put React's comment markers inside it.
+ *
+ * No greeting: Auth knows the recipient only by email address.
+ */
+export const AUTH_TOKEN = "{{ .Token }}";
+
+type AuthEmailProps = {
+ preview: string;
+ eyebrow: string;
+ heading: string;
+ /** What to do, in the callout. */
+ intro: string;
+ /** The 6-digit code, under the intro, when this email has one. */
+ showCode?: boolean;
+ action: { href: string; label: string };
+ /** Why they got it, in the footer. */
+ footnote?: string;
+};
+
+export function AuthEmail({
+ preview,
+ eyebrow,
+ heading,
+ intro,
+ showCode = false,
+ action,
+ footnote
+}: AuthEmailProps) {
+ const themeClasses = getEmailThemeClasses();
+
+ return (
+ <EmailThemeProvider
+ preview={<Preview>{preview}</Preview>}
+ additionalHeadContent={<style>{notificationStyles}</style>}
+ >
+ <Body
+ className={`my-auto mx-auto font-sans nf-body ${themeClasses.body}`}
+ >
+ <Container
+ className={`my-[40px] mx-auto p-[36px] max-w-[560px] rounded-[16px] nf-card ${themeClasses.container}`}
+ style={{
+ borderRadius: 16,
+ borderStyle: "solid",
+ borderWidth: 1
+ }}
+ >
+ <Logo />
+
+ <Text
+ className={`text-[11px] leading-[16px] uppercase text-center font-medium m-0 mt-[40px] mb-[10px] nf-eyebrow ${themeClasses.mutedText}`}
+ style={{ letterSpacing: "0.14em" }}
+ >
+ {eyebrow}
+ </Text>
+
+ <Heading
+ className={`text-[26px] font-medium text-center tracking-tight p-0 mt-0 mb-[32px] mx-0 ${themeClasses.heading}`}
+ >
+ {heading}
+ </Heading>
+
+ <Section
+ className="nf-callout"
+ style={{
+ backgroundColor: "#fafafa",
+ borderColor: "#ececef",
+ borderRadius: 12,
+ borderStyle: "solid",
+ borderWidth: 1,
+ marginBottom: 28,
+ padding: "18px 20px"
+ }}
+ >
+ <table
+ role="presentation"
+ cellPadding={0}
+ cellSpacing={0}
+ width="100%"
+ style={{ borderCollapse: "collapse", width: "100%" }}
+ >
+ <tr>
+ <td style={{ verticalAlign: "middle" }}>
+ <Text
+ className={`text-[15px] leading-[24px] m-0 ${themeClasses.text}`}
+ >
+ {intro}
+ </Text>
+ {showCode ? (
+ <Text
+ className={`text-[32px] leading-[40px] font-mono font-medium text-center m-0 mt-[16px] ${themeClasses.heading}`}
+ style={{ letterSpacing: "0.3em" }}
+ >
+ {AUTH_TOKEN}
+ </Text>
+ ) : null}
+ </td>
+ </tr>
+ </table>
+ </Section>
+
+ <Section className="text-center mb-[24px]">
+ <Button
+ href={action.href}
+ className="nf-cta"
+ style={{
+ backgroundColor: "#0e0e0e",
+ borderColor: "#0e0e0e",
+ borderRadius: 10,
+ borderStyle: "solid",
+ borderWidth: 1,
+ color: "#ffffff",
+ display: "inline-block",
+ fontSize: 14,
+ fontWeight: 500,
+ padding: "13px 24px",
+ textAlign: "center",
+ textDecoration: "none"
+ }}
+ >
+ <span style={{ verticalAlign: "middle" }}>{action.label}</span>
+ </Button>
+ </Section>
+
+ <Text
+ className={`text-[13px] leading-[20px] m-0 text-center break-all nf-fallback ${themeClasses.mutedText}`}
+ >
+ Or open this link in your browser:{" "}
+ <Link
+ href={action.href}
+ className={`${themeClasses.mutedText} underline nf-fallback`}
+ >
+ {action.href}
+ </Link>
+ </Text>
+
+ {footnote ? (
+ <>
+ <Hr className={`my-[32px] nf-divider ${themeClasses.border}`} />
+ <Text
+ className={`text-[12px] leading-[18px] m-0 nf-fallback ${themeClasses.mutedText}`}
+ >
+ {footnote}
+ </Text>
+ </>
+ ) : null}
+ </Container>
+ </Body>
+ </EmailThemeProvider>
+ );
+}
diff --git a/packages/documents/src/email/auth/auth.test.tsx b/packages/documents/src/email/auth/auth.test.tsx
new file mode 100644
index 0000000000..0c232665de
--- /dev/null
+++ b/packages/documents/src/email/auth/auth.test.tsx
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { renderAsync } from "@react-email/components";
+import { describe, expect, it } from "vitest";
+import { authEmails } from ".";
+
+// What Auth fills in, by email. A placeholder React split with a comment
+// marker, or escaped, would reach the recipient as the raw braces.
+const placeholders: Record<keyof typeof authEmails, string[]> = {
+ "magic-link.html": [
+ "{{ .Token }}",
+ 'href="{{ .SiteURL }}/magic-link?token={{ .TokenHash }}"'
+ ],
+ "invite.html": [
+ 'href="{{ .SiteURL }}/confirm-invite?token={{ .TokenHash }}"'
+ ],
+ "confirmation.html": ["{{ .Token }}", 'href="{{ .ConfirmationURL }}"'],
+ "recovery.html": ['href="{{ .ConfirmationURL }}"'],
+ "email-change.html": [
+ "{{ .Email }} to {{ .NewEmail }}",
+ 'href="{{ .ConfirmationURL }}"'
+ ]
+};
+
+// A code is offered only where a Carbon screen takes it.
+const withCode = new Set(["magic-link.html", "confirmation.html"]);
+
+describe("auth emails", () => {
+ for (const [file, Email] of Object.entries(authEmails)) {
+ it(`${file} carries Auth's placeholders intact`, async () => {
+ const html = await renderAsync(<Email />);
+ for (const expected of placeholders[file as keyof typeof authEmails]) {
+ expect(html).toContain(expected);
+ }
+ expect(html).not.toMatch(/\{\{[^}]*<!--/);
+ expect(html.includes("{{ .Token }}")).toBe(withCode.has(file));
+ // The card's dark-mode classes.
+ expect(html).toContain("nf-card");
+ });
+ }
+});
diff --git a/packages/documents/src/email/auth/index.tsx b/packages/documents/src/email/auth/index.tsx
new file mode 100644
index 0000000000..932e3c359e
--- /dev/null
+++ b/packages/documents/src/email/auth/index.tsx
@@ -0,0 +1,89 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { AUTH_TOKEN, AuthEmail } from "./AuthEmail";
+
+/** Auth's placeholders, each filled in by Auth when it sends. */
+const SITE_URL = "{{ .SiteURL }}";
+const TOKEN_HASH = "{{ .TokenHash }}";
+const CONFIRMATION_URL = "{{ .ConfirmationURL }}";
+const ONCE = "The code and the button are the same sign-in: use either, once.";
+const IGNORE = "If you didn't ask for this, you can ignore this email.";
+
+export const AuthMagicLinkEmail = () => (
+ <AuthEmail
+ preview={`Your Carbon sign-in code is ${AUTH_TOKEN}`}
+ eyebrow="Sign in"
+ heading="Sign in to Carbon"
+ intro="Enter this code on the sign-in screen, or use the button below."
+ showCode
+ action={{
+ href: `${SITE_URL}/magic-link?token=${TOKEN_HASH}`,
+ label: "Sign in"
+ }}
+ footnote={`${ONCE} ${IGNORE}`}
+ />
+);
+
+export const AuthInviteEmail = () => (
+ <AuthEmail
+ preview="You have been invited to Carbon"
+ eyebrow="Invitation"
+ heading="You've been invited to Carbon"
+ intro="You've been invited to create an account on Carbon."
+ action={{
+ href: `${SITE_URL}/confirm-invite?token=${TOKEN_HASH}`,
+ label: "Accept the invite"
+ }}
+ />
+);
+
+// When this reaches someone signing in, the sign-in screen's code field
+// accepts its code: type "email" covers confirmation tokens.
+export const AuthConfirmationEmail = () => (
+ <AuthEmail
+ preview={`Your Carbon sign-in code is ${AUTH_TOKEN}`}
+ eyebrow="Sign in"
+ heading="Confirm your email"
+ intro="Enter this code on the sign-in screen, or use the button below to confirm your email address."
+ showCode
+ action={{ href: CONFIRMATION_URL, label: "Confirm your email" }}
+ footnote={IGNORE}
+ />
+);
+
+export const AuthRecoveryEmail = () => (
+ <AuthEmail
+ preview="Reset your Carbon password"
+ eyebrow="Security"
+ heading="Reset your password"
+ intro="Use the button below to reset your password."
+ action={{ href: CONFIRMATION_URL, label: "Reset your password" }}
+ footnote={IGNORE}
+ />
+);
+
+export const AuthEmailChangeEmail = () => (
+ <AuthEmail
+ preview="Confirm your new email for Carbon"
+ eyebrow="Security"
+ heading="Confirm your new email"
+ intro="Confirm the change of your Carbon email from {{ .Email }} to {{ .NewEmail }}."
+ action={{ href: CONFIRMATION_URL, label: "Confirm the new email" }}
+ footnote={IGNORE}
+ />
+);
+
+/**
+ * Auth's emails, by the file name Auth downloads each from. Not
+ * reauthentication: that email is only a code, and Carbon has no screen to
+ * enter it, so Auth keeps its own.
+ */
+export const authEmails = {
+ "magic-link.html": AuthMagicLinkEmail,
+ "invite.html": AuthInviteEmail,
+ "confirmation.html": AuthConfirmationEmail,
+ "recovery.html": AuthRecoveryEmail,
+ "email-change.html": AuthEmailChangeEmail
+} as const;
diff --git a/packages/documents/src/email/index.ts b/packages/documents/src/email/index.ts
index 5f60ba868a..0fed89da64 100644
--- a/packages/documents/src/email/index.ts
+++ b/packages/documents/src/email/index.ts
@@ -18,12 +18,19 @@ import VerificationEmail from "./VerificationEmail";
import WeeklyReminderEmail from "./WeeklyReminderEmail";
import WelcomeEmail from "./WelcomeEmail";
+export {
+ AuthConfirmationEmail,
+ AuthEmailChangeEmail,
+ AuthInviteEmail,
+ AuthMagicLinkEmail,
+ AuthRecoveryEmail,
+ authEmails
+} from "./auth";
export {
isReminderItemStatus,
type ReminderItemStatus,
reminderItemStatuses
} from "./WeeklyReminderEmail";
-
export {
ChangelogEntryEmail,
CompanyDeletionWarningEmail,
diff --git a/packages/documents/src/email/previews/AuthConfirmationEmail.tsx b/packages/documents/src/email/previews/AuthConfirmationEmail.tsx
new file mode 100644
index 0000000000..adcb7c791a
--- /dev/null
+++ b/packages/documents/src/email/previews/AuthConfirmationEmail.tsx
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { AuthConfirmationEmail } from "../auth";
+
+// Auth fills the {{ . }} placeholders when it sends; the preview shows them raw.
+export default function AuthConfirmationEmailPreview() {
+ return <AuthConfirmationEmail />;
+}
diff --git a/packages/documents/src/email/previews/AuthEmailChangeEmail.tsx b/packages/documents/src/email/previews/AuthEmailChangeEmail.tsx
new file mode 100644
index 0000000000..99d3e4ebe5
--- /dev/null
+++ b/packages/documents/src/email/previews/AuthEmailChangeEmail.tsx
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { AuthEmailChangeEmail } from "../auth";
+
+// Auth fills the {{ . }} placeholders when it sends; the preview shows them raw.
+export default function AuthEmailChangeEmailPreview() {
+ return <AuthEmailChangeEmail />;
+}
diff --git a/packages/documents/src/email/previews/AuthInviteEmail.tsx b/packages/documents/src/email/previews/AuthInviteEmail.tsx
new file mode 100644
index 0000000000..db319d56b7
--- /dev/null
+++ b/packages/documents/src/email/previews/AuthInviteEmail.tsx
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { AuthInviteEmail } from "../auth";
+
+// Auth fills the {{ . }} placeholders when it sends; the preview shows them raw.
+export default function AuthInviteEmailPreview() {
+ return <AuthInviteEmail />;
+}
diff --git a/packages/documents/src/email/previews/AuthMagicLinkEmail.tsx b/packages/documents/src/email/previews/AuthMagicLinkEmail.tsx
new file mode 100644
index 0000000000..b3b8eeb63f
--- /dev/null
+++ b/packages/documents/src/email/previews/AuthMagicLinkEmail.tsx
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { AuthMagicLinkEmail } from "../auth";
+
+// Auth fills the {{ . }} placeholders when it sends; the preview shows them raw.
+export default function AuthMagicLinkEmailPreview() {
+ return <AuthMagicLinkEmail />;
+}
diff --git a/packages/documents/src/email/previews/AuthRecoveryEmail.tsx b/packages/documents/src/email/previews/AuthRecoveryEmail.tsx
new file mode 100644
index 0000000000..d75f7e31d7
--- /dev/null
+++ b/packages/documents/src/email/previews/AuthRecoveryEmail.tsx
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { AuthRecoveryEmail } from "../auth";
+
+// Auth fills the {{ . }} placeholders when it sends; the preview shows them raw.
+export default function AuthRecoveryEmailPreview() {
+ return <AuthRecoveryEmail />;
+}
diff --git a/packages/env/src/index.ts b/packages/env/src/index.ts
index ba424fef28..8ceb7bf3f0 100644
--- a/packages/env/src/index.ts
+++ b/packages/env/src/index.ts
@@ -119,6 +119,16 @@ export const CONTROLLED_ENVIRONMENT = parseBoolean(itarEnvironment, false);
export const MAINTENANCE_MODE = parseBoolean(getEnv("MAINTENANCE_MODE"), false);
+// A sign-in link completes only in the browser that asked for it. Mail
+// security sandboxes (Microsoft Defender) open links in a real browser and
+// press the page's button; without this they spend the one-time token, and
+// the person's own click finds it used. Elsewhere the email's code still
+// works. Server-only, like the other auth switches.
+export const MAGIC_LINK_SAME_BROWSER = parseBoolean(
+ getEnv("MAGIC_LINK_SAME_BROWSER"),
+ false
+);
+
export const SYSTEM_STATUS_URL = getEnv("SYSTEM_STATUS_URL");
export const INTEGRATION_EARLY_ACCESS_USER_IDS = getEnv(
diff --git a/packages/env/src/schema.ts b/packages/env/src/schema.ts
index 6994a33d96..0e87f49712 100644
--- a/packages/env/src/schema.ts
+++ b/packages/env/src/schema.ts
@@ -238,6 +238,11 @@ export const schema = define({
secret: true,
required: "error"
},
+ MAGIC_LINK_SAME_BROWSER: {
+ group: "auth",
+ description:
+ "true: a sign-in link completes only in the browser that asked for it; needs DOMAIN, ignored without it (false)"
+ },
AUTH_COOKIE_SUFFIX: {
group: "auth",
description:
diff --git a/packages/form/src/components/InputOTP.tsx b/packages/form/src/components/InputOTP.tsx
index b28809c3ad..b17d394929 100644
--- a/packages/form/src/components/InputOTP.tsx
+++ b/packages/form/src/components/InputOTP.tsx
@@ -96,6 +96,8 @@ const InputOTP = forwardRef<HTMLInputElement, FormInputOTPProps>(
) : null}
<InputOTPBase
+ // FormLabel points at FormControl's generated id, not this input.
+ aria-label={typeof label === "string" && label ? label : undefined}
name={name}
maxLength={6}
value={value}
diff --git a/packages/kv/src/index.ts b/packages/kv/src/index.ts
index 2c702b7bd9..637d73285e 100644
--- a/packages/kv/src/index.ts
+++ b/packages/kv/src/index.ts
@@ -21,7 +21,8 @@ export {
evaluateLockFromPttl,
lockDurationSeconds,
maxAttemptsForRateLimit,
- normalizeLoginIdentifier
+ normalizeLoginIdentifier,
+ SIGN_IN_CODE_LOCKOUT_PREFIX
} from "./lockout";
export type {
Duration,
diff --git a/packages/kv/src/lockout/index.ts b/packages/kv/src/lockout/index.ts
index f6b9982795..43a9d25235 100644
--- a/packages/kv/src/lockout/index.ts
+++ b/packages/kv/src/lockout/index.ts
@@ -17,5 +17,6 @@ export {
evaluateLockFromPttl,
lockDurationSeconds,
maxAttemptsForRateLimit,
- normalizeLoginIdentifier
+ normalizeLoginIdentifier,
+ SIGN_IN_CODE_LOCKOUT_PREFIX
} from "./lockout";
diff --git a/packages/kv/src/lockout/lockout.test.ts b/packages/kv/src/lockout/lockout.test.ts
index 143b6ae1ef..8e53bcff9c 100644
--- a/packages/kv/src/lockout/lockout.test.ts
+++ b/packages/kv/src/lockout/lockout.test.ts
@@ -3,7 +3,8 @@
// including ports, remain AGPLv3; serving them over a network requires releasing their source.
import type { Redis } from "ioredis";
-import { beforeEach, describe, expect, it, vi } from "vitest";
+import RedisMock from "ioredis-mock";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import {
AccountLockout,
DEFAULT_BASE_LOCK_SECONDS,
@@ -282,3 +283,42 @@ describe("maxAttemptsForRateLimit", () => {
expect(maxAttemptsForRateLimit(Number.NaN)).toBe(DEFAULT_MAX_ATTEMPTS);
});
});
+
+// The real window scripts (ioredis-mock runs them), as in ratelimit.test.ts.
+describe("AccountLockout.refund against the real window scripts", () => {
+ beforeEach(async () => {
+ vi.useFakeTimers({ toFake: ["Date"] });
+ vi.setSystemTime(new Date("2024-01-01T00:07:00.000Z"));
+ await new RedisMock().flushall();
+ });
+
+ afterEach(() => {
+ vi.useRealTimers();
+ });
+
+ it("gives back a counted attempt, so it never adds up to a lock", async () => {
+ const lockout = new AccountLockout({
+ redis: new RedisMock() as unknown as Redis,
+ maxAttempts: 2
+ });
+ await lockout.recordFailure("[email protected]");
+ await lockout.recordFailure("[email protected]");
+ await lockout.refund("[email protected]");
+ expect((await lockout.recordFailure("[email protected]")).locked).toBe(false);
+ expect((await lockout.recordFailure("[email protected]")).locked).toBe(true);
+ });
+
+ it("keeps each prefix's attempts apart", async () => {
+ const redis = new RedisMock() as unknown as Redis;
+ const code = new AccountLockout({
+ redis,
+ maxAttempts: 1,
+ prefix: "@carbon/lockout-code"
+ });
+ await code.recordFailure("[email protected]");
+ expect((await code.recordFailure("[email protected]")).locked).toBe(true);
+ expect(
+ (await new AccountLockout({ redis }).status("[email protected]")).locked
+ ).toBe(false);
+ });
+});
diff --git a/packages/kv/src/lockout/lockout.ts b/packages/kv/src/lockout/lockout.ts
index 3b6612d15b..2c1e36bb2b 100644
--- a/packages/kv/src/lockout/lockout.ts
+++ b/packages/kv/src/lockout/lockout.ts
@@ -47,6 +47,12 @@ export function maxAttemptsForRateLimit(ratePerHour: number): number {
const DEFAULT_PREFIX = "@carbon/lockout";
+/**
+ * The sign-in code's own lockout. Wrong codes lock code sign-in only, so
+ * guessing at someone's code cannot also stop them asking for a link.
+ */
+export const SIGN_IN_CODE_LOCKOUT_PREFIX = "@carbon/lockout-code";
+
/**
* Normalize an email into the lockout key: trim + lowercase so `[email protected] `,
* `[email protected]`, and `[email protected]` all count against ONE account. Keys are derived
@@ -220,6 +226,16 @@ export class AccountLockout {
}
}
+ /**
+ * Give back the attempt the last `recordFailure` counted, for callers that
+ * count BEFORE the check (so a concurrent burst cannot all pass) and then
+ * learn the check never ran — an outage is not a wrong guess. An attempt
+ * that engaged a lock is not undone; the caller never runs the check then.
+ */
+ async refund(email: string): Promise<void> {
+ await this.ratelimit.refund(normalizeLoginIdentifier(email));
+ }
+
/**
* Clear all lockout state for an account after a genuine success (e.g. the dev
* bypass sign-in). Escalation history is dropped too.
diff --git a/packages/locale/locales/de/erp.po b/packages/locale/locales/de/erp.po
index bfd31df7bf..fdd918f16d 100644
--- a/packages/locale/locales/de/erp.po
+++ b/packages/locale/locales/de/erp.po
@@ -16027,6 +16027,9 @@ msgstr "Öffnen Sie die Ramp-Integration und versuchen Sie erneut, die Verbindun
msgid "Open the Setup Map"
msgstr "Öffnen Sie die Setup-Karte"
+msgid "Open this link in the browser where you asked to sign in, or enter the 6-digit code from the email there."
+msgstr ""
+
msgid "Open transactions"
msgstr "Offene Transaktionen"
@@ -21373,12 +21376,18 @@ msgstr "Wird dem Benutzer angezeigt, wenn diese Regel fehlschlägt."
msgid "Shuffle"
msgstr "Mischen"
+msgid "Sign in here instead"
+msgstr ""
+
msgid "Sign in to Carbon"
msgstr "Bei Carbon anmelden"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Melden Sie sich mit Biometrie statt mit einem Magic Link an. Passkeys sind durch Face ID, Touch ID oder Ihre Geräte-PIN gesichert."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Mit Google anmelden"
@@ -21397,6 +21406,9 @@ msgstr "Abmelden"
msgid "Sign out instead"
msgstr "Stattdessen abmelden"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Sign-off review before moving to the next step"
msgstr "Freigabeüberprüfung vor dem Wechsel zum nächsten Schritt"
@@ -26097,15 +26109,15 @@ msgstr "Wir haben jede Spalte automatisch abgeglichen. Bitte überprüfen Sie di
msgid "We triage and fix issues fast while your team settles in"
msgstr "Wir priorisieren und beheben Probleme schnell, während sich Ihr Team einarbeitet"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
+
msgid "We've sent a verification code to {email}"
msgstr "Wir haben einen Verifizierungscode an {email} gesendet"
msgid "We've sent a verification code to {signupEmail}"
msgstr "Wir haben einen Verifizierungscode an {signupEmail} gesendet"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Wir haben dir einen Magic Link zum Anmelden bei deinem Konto gesendet."
-
msgid "Webhook"
msgstr "Webhook"
diff --git a/packages/locale/locales/de/mes.po b/packages/locale/locales/de/mes.po
index 7076762efa..5b47d87f5d 100644
--- a/packages/locale/locales/de/mes.po
+++ b/packages/locale/locales/de/mes.po
@@ -1862,6 +1862,9 @@ msgstr "Mischen"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Melden Sie sich mit Biometrie anstelle eines Magic Link an. Passkeys werden durch Face ID, Touch ID oder Ihre Geräte-PIN geschützt."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Mit Google anmelden"
@@ -1880,6 +1883,9 @@ msgstr "Abmelden"
msgid "Sign out instead"
msgstr "Stattdessen abmelden"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Signed in as {stationName}"
msgstr "Angemeldet als {stationName}"
@@ -2230,8 +2236,8 @@ msgstr "Instandhaltungseinsatz anzeigen"
msgid "View or open"
msgstr "Anzeigen oder Öffnen"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Wir haben Ihnen einen Magic Link zur Anmeldung an Ihrem Konto gesendet."
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
msgid "What is {translatedTerm}?"
msgstr "{translatedTerm} ist was?"
diff --git a/packages/locale/locales/en/erp.po b/packages/locale/locales/en/erp.po
index 8e8fd854eb..48796ef226 100644
--- a/packages/locale/locales/en/erp.po
+++ b/packages/locale/locales/en/erp.po
@@ -16027,6 +16027,9 @@ msgstr "Open the Ramp integration and try connecting again to finish setup."
msgid "Open the Setup Map"
msgstr "Open the Setup Map"
+msgid "Open this link in the browser where you asked to sign in, or enter the 6-digit code from the email there."
+msgstr "Open this link in the browser where you asked to sign in, or enter the 6-digit code from the email there."
+
msgid "Open transactions"
msgstr "Open transactions"
@@ -21373,12 +21376,18 @@ msgstr "Shown to the user when this rule fails."
msgid "Shuffle"
msgstr "Shuffle"
+msgid "Sign in here instead"
+msgstr "Sign in here instead"
+
msgid "Sign in to Carbon"
msgstr "Sign in to Carbon"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
+msgid "Sign in with code"
+msgstr "Sign in with code"
+
msgid "Sign in with Google"
msgstr "Sign in with Google"
@@ -21397,6 +21406,9 @@ msgstr "Sign Out"
msgid "Sign out instead"
msgstr "Sign out instead"
+msgid "Sign-in code"
+msgstr "Sign-in code"
+
msgid "Sign-off review before moving to the next step"
msgstr "Sign-off review before moving to the next step"
@@ -26097,15 +26109,15 @@ msgstr "We auto-matched each column. Review the values below before continuing."
msgid "We triage and fix issues fast while your team settles in"
msgstr "We triage and fix issues fast while your team settles in"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+
msgid "We've sent a verification code to {email}"
msgstr "We've sent a verification code to {email}"
msgid "We've sent a verification code to {signupEmail}"
msgstr "We've sent a verification code to {signupEmail}"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "We've sent you a magic link to sign in to your account."
-
msgid "Webhook"
msgstr "Webhook"
diff --git a/packages/locale/locales/en/mes.po b/packages/locale/locales/en/mes.po
index d439670c66..beb4df61eb 100644
--- a/packages/locale/locales/en/mes.po
+++ b/packages/locale/locales/en/mes.po
@@ -1862,6 +1862,9 @@ msgstr "Shuffle"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
+msgid "Sign in with code"
+msgstr "Sign in with code"
+
msgid "Sign in with Google"
msgstr "Sign in with Google"
@@ -1880,6 +1883,9 @@ msgstr "Sign Out"
msgid "Sign out instead"
msgstr "Sign out instead"
+msgid "Sign-in code"
+msgstr "Sign-in code"
+
msgid "Signed in as {stationName}"
msgstr "Signed in as {stationName}"
@@ -2230,8 +2236,8 @@ msgstr "View maintenance dispatch"
msgid "View or open"
msgstr "View or open"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "We've sent you a magic link to sign in to your account."
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
msgid "What is {translatedTerm}?"
msgstr "What is {translatedTerm}?"
diff --git a/packages/locale/locales/es/erp.po b/packages/locale/locales/es/erp.po
index 7ae6b37f72..6b51418796 100644
--- a/packages/locale/locales/es/erp.po
+++ b/packages/locale/locales/es/erp.po
@@ -16027,6 +16027,9 @@ msgstr "Abre la integración de Ramp y vuelve a intentar la conexión para final
msgid "Open the Setup Map"
msgstr "Abrir el Mapa de Configuración"
+msgid "Open this link in the browser where you asked to sign in, or enter the 6-digit code from the email there."
+msgstr ""
+
msgid "Open transactions"
msgstr "Transacciones abiertas"
@@ -21373,12 +21376,18 @@ msgstr "Mostrado al usuario cuando falla esta regla."
msgid "Shuffle"
msgstr "Mezclar"
+msgid "Sign in here instead"
+msgstr ""
+
msgid "Sign in to Carbon"
msgstr "Inicie sesión en Carbon"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Inicie sesión con biometría en lugar de un enlace mágico. Las llaves de acceso se aseguran con Face ID, Touch ID o su PIN de dispositivo."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Iniciar sesión con Google"
@@ -21397,6 +21406,9 @@ msgstr "Cerrar sesión"
msgid "Sign out instead"
msgstr "Cerrar sesión en su lugar"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Sign-off review before moving to the next step"
msgstr "Revisión de aprobación antes de pasar al siguiente paso"
@@ -26097,15 +26109,15 @@ msgstr "Coincidimos automáticamente con cada columna. Revise los valores a cont
msgid "We triage and fix issues fast while your team settles in"
msgstr "Triamos y solucionamos problemas rápidamente mientras tu equipo se adapta"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
+
msgid "We've sent a verification code to {email}"
msgstr "Hemos enviado un código de verificación a {email}"
msgid "We've sent a verification code to {signupEmail}"
msgstr "Hemos enviado un código de verificación a {signupEmail}"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Te hemos enviado un enlace mágico para iniciar sesión en tu cuenta."
-
msgid "Webhook"
msgstr "Webhook"
diff --git a/packages/locale/locales/es/mes.po b/packages/locale/locales/es/mes.po
index 8ea773c95c..d9ac35212a 100644
--- a/packages/locale/locales/es/mes.po
+++ b/packages/locale/locales/es/mes.po
@@ -1862,6 +1862,9 @@ msgstr "Mezclar"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Inicia sesión con biometría en lugar de un enlace mágico. Las llaves de acceso están protegidas por Face ID, Touch ID o tu PIN del dispositivo."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Iniciar sesión con Google"
@@ -1880,6 +1883,9 @@ msgstr "Cerrar sesión"
msgid "Sign out instead"
msgstr "Cerrar sesión en su lugar"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Signed in as {stationName}"
msgstr "Conectado como {stationName}"
@@ -2230,8 +2236,8 @@ msgstr "Ver orden de mantenimiento"
msgid "View or open"
msgstr "Ver o abrir"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Le hemos enviado un enlace mágico para iniciar sesión en su cuenta."
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
msgid "What is {translatedTerm}?"
msgstr "¿Qué es {translatedTerm}?"
diff --git a/packages/locale/locales/fr/erp.po b/packages/locale/locales/fr/erp.po
index 3eaa9b9b1f..6f931207bc 100644
--- a/packages/locale/locales/fr/erp.po
+++ b/packages/locale/locales/fr/erp.po
@@ -16027,6 +16027,9 @@ msgstr "Ouvrez l’intégration Ramp et essayez de vous reconnecter pour termine
msgid "Open the Setup Map"
msgstr "Ouvrir la carte de configuration"
+msgid "Open this link in the browser where you asked to sign in, or enter the 6-digit code from the email there."
+msgstr ""
+
msgid "Open transactions"
msgstr "Transactions ouvertes"
@@ -21373,12 +21376,18 @@ msgstr "Affiché à l'utilisateur quand cette règle échoue."
msgid "Shuffle"
msgstr "Mélanger"
+msgid "Sign in here instead"
+msgstr ""
+
msgid "Sign in to Carbon"
msgstr "Se connecter à Carbon"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Connectez-vous avec la biométrie au lieu d'un lien magique. Les clés d'accès sont sécurisées par Face ID, Touch ID ou votre code PIN de l'appareil."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Se connecter avec Google"
@@ -21397,6 +21406,9 @@ msgstr "Se déconnecter"
msgid "Sign out instead"
msgstr "Se déconnecter à la place"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Sign-off review before moving to the next step"
msgstr "Revue de validation avant de passer à l'étape suivante"
@@ -26097,15 +26109,15 @@ msgstr "Nous avons automatiquement mis en correspondance chaque colonne. Vérifi
msgid "We triage and fix issues fast while your team settles in"
msgstr "Nous trions et résolvons les problèmes rapidement pendant que votre équipe s'adapte"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
+
msgid "We've sent a verification code to {email}"
msgstr "Nous avons envoyé un code de vérification à {email}"
msgid "We've sent a verification code to {signupEmail}"
msgstr "Nous avons envoyé un code de vérification à {signupEmail}"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Nous vous avons envoyé un lien magique pour vous connecter à votre compte."
-
msgid "Webhook"
msgstr "Webhook"
diff --git a/packages/locale/locales/fr/mes.po b/packages/locale/locales/fr/mes.po
index 4ac4df80f4..a21ba8ba4c 100644
--- a/packages/locale/locales/fr/mes.po
+++ b/packages/locale/locales/fr/mes.po
@@ -1862,6 +1862,9 @@ msgstr "Mélanger"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Connectez-vous avec la biométrie au lieu d'un lien magique. Les clés d'accès sont sécurisées par Face ID, Touch ID ou votre code PIN d'appareil."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Se connecter avec Google"
@@ -1880,6 +1883,9 @@ msgstr "Se déconnecter"
msgid "Sign out instead"
msgstr "Se déconnecter plutôt"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Signed in as {stationName}"
msgstr "Connecté en tant que {stationName}"
@@ -2230,8 +2236,8 @@ msgstr "Voir l'intervention de maintenance"
msgid "View or open"
msgstr "Afficher ou ouvrir"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Nous vous avons envoyé un lien magique pour vous connecter à votre compte."
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
msgid "What is {translatedTerm}?"
msgstr "Qu'est-ce que {translatedTerm} ?"
diff --git a/packages/locale/locales/hi/erp.po b/packages/locale/locales/hi/erp.po
index bd428aa8d7..824c13c061 100644
--- a/packages/locale/locales/hi/erp.po
+++ b/packages/locale/locales/hi/erp.po
@@ -16027,6 +16027,9 @@ msgstr "Ramp एकीकरण खोलें और कॉन्फ़िग
msgid "Open the Setup Map"
msgstr "सेटअप मैप खोलें"
+msgid "Open this link in the browser where you asked to sign in, or enter the 6-digit code from the email there."
+msgstr ""
+
msgid "Open transactions"
msgstr "खुले लेनदेन"
@@ -21373,12 +21376,18 @@ msgstr "जब यह नियम विफल हो तब उपयोगक
msgid "Shuffle"
msgstr "शफ़ल करें"
+msgid "Sign in here instead"
+msgstr ""
+
msgid "Sign in to Carbon"
msgstr "Carbon में साइन इन करें"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "जादुई लिंक के बजाय बायोमेट्रिक्स के साथ साइन इन करें। पासकीज़ Face ID, Touch ID, या आपकी डिवाइस PIN द्वारा सुरक्षित हैं।"
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Google के साथ साइन इन करें"
@@ -21397,6 +21406,9 @@ msgstr "साइन आउट"
msgid "Sign out instead"
msgstr "बजाय इसके साइन आउट करें"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Sign-off review before moving to the next step"
msgstr "अगले चरण में जाने से पहले साइन-ऑफ समीक्षा"
@@ -26097,15 +26109,15 @@ msgstr "हमने प्रत्येक कॉलम को स्वच
msgid "We triage and fix issues fast while your team settles in"
msgstr "हम तेजी से समस्याओं को प्राथमिकता देते हैं और ठीक करते हैं जबकि आपकी टीम सिस्टम में स्थिर होती है"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
+
msgid "We've sent a verification code to {email}"
msgstr "हमने {email} को एक सत्यापन कोड भेजा है"
msgid "We've sent a verification code to {signupEmail}"
msgstr "हमने {signupEmail} को एक सत्यापन कोड भेजा है"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "हमने आपके खाते में साइन इन करने के लिए आपको एक जादुई लिंक भेजा है।"
-
msgid "Webhook"
msgstr "वेबहुक"
diff --git a/packages/locale/locales/hi/mes.po b/packages/locale/locales/hi/mes.po
index 3860d69d63..151a1de37e 100644
--- a/packages/locale/locales/hi/mes.po
+++ b/packages/locale/locales/hi/mes.po
@@ -1862,6 +1862,9 @@ msgstr "शफल करें"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "जादुई लिंक के बजाय बायोमेट्रिक्स से साइन इन करें। पासकी को Face ID, Touch ID, या आपकी डिवाइस PIN द्वारा सुरक्षित किया जाता है।"
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Google के साथ साइन इन करें"
@@ -1880,6 +1883,9 @@ msgstr "साइन आउट"
msgid "Sign out instead"
msgstr "इसके बजाय साइन आउट करें"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Signed in as {stationName}"
msgstr "के रूप में साइन इन किया गया {stationName}"
@@ -2230,8 +2236,8 @@ msgstr "रखरखाव कार्य देखें"
msgid "View or open"
msgstr "देखें या खोलें"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "हमने आपके खाते में साइन इन करने के लिए आपको एक जादुई लिंक भेजा है।"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
msgid "What is {translatedTerm}?"
msgstr "{translatedTerm} क्या है?"
diff --git a/packages/locale/locales/it/erp.po b/packages/locale/locales/it/erp.po
index bbafba9328..87c01537a1 100644
--- a/packages/locale/locales/it/erp.po
+++ b/packages/locale/locales/it/erp.po
@@ -16027,6 +16027,9 @@ msgstr "Apri l'integrazione Ramp e prova a connetterti di nuovo per completare l
msgid "Open the Setup Map"
msgstr "Apri la Mappa di Configurazione"
+msgid "Open this link in the browser where you asked to sign in, or enter the 6-digit code from the email there."
+msgstr ""
+
msgid "Open transactions"
msgstr "Transazioni aperte"
@@ -21373,12 +21376,18 @@ msgstr "Mostrato all'utente quando questa regola fallisce."
msgid "Shuffle"
msgstr "Mescola"
+msgid "Sign in here instead"
+msgstr ""
+
msgid "Sign in to Carbon"
msgstr "Accedi a Carbon"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Accedi con biometrica invece di un magic link. Le passkey sono protette da Face ID, Touch ID o dal PIN del tuo dispositivo."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Accedi con Google"
@@ -21397,6 +21406,9 @@ msgstr "Esci"
msgid "Sign out instead"
msgstr "Esci invece"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Sign-off review before moving to the next step"
msgstr "Revisione di approvazione prima di passare al passaggio successivo"
@@ -26097,15 +26109,15 @@ msgstr "Abbiamo abbinato automaticamente ogni colonna. Esamina i valori qui sott
msgid "We triage and fix issues fast while your team settles in"
msgstr "Triamo e risolviamo i problemi rapidamente mentre il tuo team si ambientalizza"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
+
msgid "We've sent a verification code to {email}"
msgstr "Abbiamo inviato un codice di verifica a {email}"
msgid "We've sent a verification code to {signupEmail}"
msgstr "Abbiamo inviato un codice di verifica a {signupEmail}"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Ti abbiamo inviato un link magico per accedere al tuo account."
-
msgid "Webhook"
msgstr "Webhook"
diff --git a/packages/locale/locales/it/mes.po b/packages/locale/locales/it/mes.po
index 635a065b6a..aa3b6a4b32 100644
--- a/packages/locale/locales/it/mes.po
+++ b/packages/locale/locales/it/mes.po
@@ -1862,6 +1862,9 @@ msgstr "Mescola"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Accedi con dati biometrici invece di un link magico. I Passkey sono protetti da Face ID, Touch ID o dal PIN del tuo dispositivo."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Accedi con Google"
@@ -1880,6 +1883,9 @@ msgstr "Esci"
msgid "Sign out instead"
msgstr "Esci invece"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Signed in as {stationName}"
msgstr "Connesso come {stationName}"
@@ -2230,8 +2236,8 @@ msgstr "Visualizza intervento di manutenzione"
msgid "View or open"
msgstr "Visualizza o apri"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Ti abbiamo inviato un link di accesso al tuo account."
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
msgid "What is {translatedTerm}?"
msgstr "Cos'è {translatedTerm}?"
diff --git a/packages/locale/locales/ja/erp.po b/packages/locale/locales/ja/erp.po
index 05e7ae3380..ecf1939e53 100644
--- a/packages/locale/locales/ja/erp.po
+++ b/packages/locale/locales/ja/erp.po
@@ -16027,6 +16027,9 @@ msgstr "Ramp 連携を開き、設定を完了するためにもう一度接続
msgid "Open the Setup Map"
msgstr "セットアップマップを開く"
+msgid "Open this link in the browser where you asked to sign in, or enter the 6-digit code from the email there."
+msgstr ""
+
msgid "Open transactions"
msgstr "未処理トランザクション"
@@ -21373,12 +21376,18 @@ msgstr "このルールが失敗したときにユーザーに表示されます
msgid "Shuffle"
msgstr "シャッフル"
+msgid "Sign in here instead"
+msgstr ""
+
msgid "Sign in to Carbon"
msgstr "Carbonにサインイン"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "マジックリンクの代わりに生体認証でサインインします。パスキーはFace ID、Touch ID、またはデバイスPINで保護されます。"
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Googleでサインイン"
@@ -21397,6 +21406,9 @@ msgstr "サインアウト"
msgid "Sign out instead"
msgstr "代わりにサインアウト"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Sign-off review before moving to the next step"
msgstr "次のステップに進む前のサインオフレビュー"
@@ -26097,15 +26109,15 @@ msgstr "各列を自動マッチングしました。続行する前に下の値
msgid "We triage and fix issues fast while your team settles in"
msgstr "チームが新しいシステムに慣れている間、問題を素早く分類して修正します"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
+
msgid "We've sent a verification code to {email}"
msgstr "検証コードを {email} に送信しました"
msgid "We've sent a verification code to {signupEmail}"
msgstr "検証コードを {signupEmail} に送信しました"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "あなたのアカウントにサインインするためのマジックリンクを送信しました。"
-
msgid "Webhook"
msgstr "Webhook"
diff --git a/packages/locale/locales/ja/mes.po b/packages/locale/locales/ja/mes.po
index 5b5f92a271..5a6bc08602 100644
--- a/packages/locale/locales/ja/mes.po
+++ b/packages/locale/locales/ja/mes.po
@@ -1862,6 +1862,9 @@ msgstr "シャッフル"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "マジックリンクの代わりに生体認証でサインインしてください。パスキーはFace ID、Touch ID、またはデバイスPINで保護されています。"
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Googleでサインイン"
@@ -1880,6 +1883,9 @@ msgstr "サインアウト"
msgid "Sign out instead"
msgstr "代わりにサインアウト"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Signed in as {stationName}"
msgstr "{stationName} としてサインイン中"
@@ -2230,8 +2236,8 @@ msgstr "保全指示を表示"
msgid "View or open"
msgstr "表示または開く"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "アカウントにサインインするためのマジックリンクをお送りしました。"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
msgid "What is {translatedTerm}?"
msgstr "{translatedTerm}とは何ですか?"
diff --git a/packages/locale/locales/ko/erp.po b/packages/locale/locales/ko/erp.po
index 30f5f26f00..7047fb9373 100644
--- a/packages/locale/locales/ko/erp.po
+++ b/packages/locale/locales/ko/erp.po
@@ -16027,6 +16027,9 @@ msgstr "Ramp 연동을 열고 다시 연결하여 설정을 완료해 보세요.
msgid "Open the Setup Map"
msgstr "설정 맵 열기"
+msgid "Open this link in the browser where you asked to sign in, or enter the 6-digit code from the email there."
+msgstr ""
+
msgid "Open transactions"
msgstr "미결 거래"
@@ -21373,12 +21376,18 @@ msgstr "이 규칙이 실패할 때 사용자에게 표시됩니다."
msgid "Shuffle"
msgstr "섞기"
+msgid "Sign in here instead"
+msgstr ""
+
msgid "Sign in to Carbon"
msgstr "Carbon에 로그인"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "매직 링크 대신 생체 인식으로 로그인하세요. 패스키는 Face ID, Touch ID 또는 기기 PIN으로 보호됩니다."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Google로 로그인"
@@ -21397,6 +21406,9 @@ msgstr "로그아웃"
msgid "Sign out instead"
msgstr "대신 로그아웃"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Sign-off review before moving to the next step"
msgstr "다음 단계로 넘어가기 전 서명 검토"
@@ -26097,15 +26109,15 @@ msgstr "각 열을 자동으로 매칭했습니다. 계속하기 전에 아래
msgid "We triage and fix issues fast while your team settles in"
msgstr "팀이 적응하는 동안 저희가 이슈를 신속하게 분류하고 해결합니다"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
+
msgid "We've sent a verification code to {email}"
msgstr "{email}로 인증 코드를 보냈습니다"
msgid "We've sent a verification code to {signupEmail}"
msgstr "{signupEmail}로 인증 코드를 보냈습니다"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "계정에 로그인할 수 있는 매직 링크를 보내드렸습니다."
-
msgid "Webhook"
msgstr "웹훅"
diff --git a/packages/locale/locales/ko/mes.po b/packages/locale/locales/ko/mes.po
index c9c1390477..e9691a1555 100644
--- a/packages/locale/locales/ko/mes.po
+++ b/packages/locale/locales/ko/mes.po
@@ -1862,6 +1862,9 @@ msgstr "섞기"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "매직 링크 대신 생체 인식으로 로그인하십시오. 패스키는 Face ID, Touch ID 또는 기기 PIN으로 보호됩니다."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Google로 로그인"
@@ -1880,6 +1883,9 @@ msgstr "로그아웃"
msgid "Sign out instead"
msgstr "대신 로그아웃"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Signed in as {stationName}"
msgstr "{stationName}(으)로 로그인됨"
@@ -2230,8 +2236,8 @@ msgstr "유지보수 지시 보기"
msgid "View or open"
msgstr "보기 또는 열기"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "계정에 로그인할 수 있는 매직 링크를 보내드렸습니다."
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
msgid "What is {translatedTerm}?"
msgstr "{translatedTerm}란 무엇인가요?"
diff --git a/packages/locale/locales/pl/erp.po b/packages/locale/locales/pl/erp.po
index 86193d08b8..6d244fb275 100644
--- a/packages/locale/locales/pl/erp.po
+++ b/packages/locale/locales/pl/erp.po
@@ -16027,6 +16027,9 @@ msgstr "Otwórz integrację Ramp i spróbuj połączyć się ponownie, aby doko
msgid "Open the Setup Map"
msgstr "Otwórz mapę konfiguracji"
+msgid "Open this link in the browser where you asked to sign in, or enter the 6-digit code from the email there."
+msgstr ""
+
msgid "Open transactions"
msgstr "Otwarte transakcje"
@@ -21373,12 +21376,18 @@ msgstr "Wyświetlane użytkownikowi, gdy ta reguła się nie powiedzie."
msgid "Shuffle"
msgstr "Przetasuj"
+msgid "Sign in here instead"
+msgstr ""
+
msgid "Sign in to Carbon"
msgstr "Zaloguj się do Carbon"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Zaloguj się za pomocą biometrii zamiast linku magicznego. Klucze dostępu są zabezpieczone za pomocą Face ID, Touch ID lub numeru PIN urządzenia."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Zaloguj się za pomocą Google"
@@ -21397,6 +21406,9 @@ msgstr "Wyloguj sie"
msgid "Sign out instead"
msgstr "Zamiast tego wyloguj się"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Sign-off review before moving to the next step"
msgstr "Przegląd zatwierdzający przed przejściem do następnego kroku"
@@ -26097,15 +26109,15 @@ msgstr "Automatycznie dopasowaliśmy każdą kolumnę. Przejrzyj wartości poni
msgid "We triage and fix issues fast while your team settles in"
msgstr "Szybko triażujemy i naprawiamy problemy, podczas gdy Twój zespół się adaptuje"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
+
msgid "We've sent a verification code to {email}"
msgstr "Wysłaliśmy kod weryfikacyjny na adres {email}"
msgid "We've sent a verification code to {signupEmail}"
msgstr "Wysłaliśmy kod weryfikacyjny na {signupEmail}"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Wysłaliśmy Ci magiczny link, aby zalogować się na Twoje konto."
-
msgid "Webhook"
msgstr "Webhook"
diff --git a/packages/locale/locales/pl/mes.po b/packages/locale/locales/pl/mes.po
index 504a601db7..6de9cf27af 100644
--- a/packages/locale/locales/pl/mes.po
+++ b/packages/locale/locales/pl/mes.po
@@ -1862,6 +1862,9 @@ msgstr "Tasuj"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Zaloguj się za pomocą biometrii zamiast magicznego linku. Klucze dostępu są chronione za pomocą Face ID, Touch ID lub PIN urządzenia."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Zaloguj się przez Google"
@@ -1880,6 +1883,9 @@ msgstr "Wyloguj się"
msgid "Sign out instead"
msgstr "Zamiast tego wyloguj się"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Signed in as {stationName}"
msgstr "Zalogowany jako {stationName}"
@@ -2230,8 +2236,8 @@ msgstr "Wyświetl zlecenie utrzymania ruchu"
msgid "View or open"
msgstr "Wyświetl lub otwórz"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Wysłaliśmy Ci link do logowania na Twoje konto."
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
msgid "What is {translatedTerm}?"
msgstr "Co to jest {translatedTerm}?"
diff --git a/packages/locale/locales/pt/erp.po b/packages/locale/locales/pt/erp.po
index f27c1507f6..2bae4af43c 100644
--- a/packages/locale/locales/pt/erp.po
+++ b/packages/locale/locales/pt/erp.po
@@ -16027,6 +16027,9 @@ msgstr "Abra a integração do Ramp e tente conectar novamente para concluir a c
msgid "Open the Setup Map"
msgstr "Abrir o Mapa de Configuração"
+msgid "Open this link in the browser where you asked to sign in, or enter the 6-digit code from the email there."
+msgstr ""
+
msgid "Open transactions"
msgstr "Transações abertas"
@@ -21373,12 +21376,18 @@ msgstr "Mostrado ao usuário quando esta regra falha."
msgid "Shuffle"
msgstr "Embaralhar"
+msgid "Sign in here instead"
+msgstr ""
+
msgid "Sign in to Carbon"
msgstr "Entrar no Carbon"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Inicie sessão com biometria em vez de uma ligação mágica. As chaves de acesso são protegidas por Face ID, Touch ID ou o PIN do seu dispositivo."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Entrar com Google"
@@ -21397,6 +21406,9 @@ msgstr "Sair"
msgid "Sign out instead"
msgstr "Sair em vez disso"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Sign-off review before moving to the next step"
msgstr "Revisão de aprovação antes de passar para a próxima etapa"
@@ -26097,15 +26109,15 @@ msgstr "Correspondemos automaticamente cada coluna. Revise os valores abaixo ant
msgid "We triage and fix issues fast while your team settles in"
msgstr "Triamos e corrigimos problemas rapidamente enquanto sua equipe se adapta"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
+
msgid "We've sent a verification code to {email}"
msgstr "Enviámos um código de verificação para {email}"
msgid "We've sent a verification code to {signupEmail}"
msgstr "Enviámos um código de verificação para {signupEmail}"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Enviámos-lhe um link mágico para iniciar sessão na sua conta."
-
msgid "Webhook"
msgstr "Webhook"
diff --git a/packages/locale/locales/pt/mes.po b/packages/locale/locales/pt/mes.po
index 353e8f9104..2149bd90e5 100644
--- a/packages/locale/locales/pt/mes.po
+++ b/packages/locale/locales/pt/mes.po
@@ -1862,6 +1862,9 @@ msgstr "Embaralhar"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Faça login com dados biométricos em vez de um link mágico. Chaves de acesso são protegidas por Face ID, Touch ID ou seu PIN do dispositivo."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Entrar com Google"
@@ -1880,6 +1883,9 @@ msgstr "Sair"
msgid "Sign out instead"
msgstr "Sair da sessão em vez disso"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Signed in as {stationName}"
msgstr "Conectado como {stationName}"
@@ -2230,8 +2236,8 @@ msgstr "Visualizar ordem de manutenção"
msgid "View or open"
msgstr "Visualizar ou abrir"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Enviamos um link mágico para você entrar na sua conta."
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
msgid "What is {translatedTerm}?"
msgstr "O que é {translatedTerm}?"
diff --git a/packages/locale/locales/ru/erp.po b/packages/locale/locales/ru/erp.po
index 0582af5ea8..3aca25525f 100644
--- a/packages/locale/locales/ru/erp.po
+++ b/packages/locale/locales/ru/erp.po
@@ -16027,6 +16027,9 @@ msgstr "Откройте интеграцию Ramp и попробуйте по
msgid "Open the Setup Map"
msgstr "Открыть карту настройки"
+msgid "Open this link in the browser where you asked to sign in, or enter the 6-digit code from the email there."
+msgstr ""
+
msgid "Open transactions"
msgstr "Открытые транзакции"
@@ -21373,12 +21376,18 @@ msgstr "Показано пользователю при ошибке этого
msgid "Shuffle"
msgstr "Перемешать"
+msgid "Sign in here instead"
+msgstr ""
+
msgid "Sign in to Carbon"
msgstr "Войти в Carbon"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Войдите с использованием биометрии вместо волшебной ссылки. Ключи доступа защищены Face ID, Touch ID или PIN-кодом вашего устройства."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Войти с помощью Google"
@@ -21397,6 +21406,9 @@ msgstr "Выход"
msgid "Sign out instead"
msgstr "Вместо этого выйти"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Sign-off review before moving to the next step"
msgstr "Подтверждение рассмотрения перед переходом к следующему шагу"
@@ -26097,15 +26109,15 @@ msgstr "Мы автоматически сопоставили каждый ст
msgid "We triage and fix issues fast while your team settles in"
msgstr "Мы быстро разбираемся с проблемами и их решаем, пока ваша команда адаптируется"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
+
msgid "We've sent a verification code to {email}"
msgstr "Мы отправили код подтверждения на {email}"
msgid "We've sent a verification code to {signupEmail}"
msgstr "Мы отправили код подтверждения на {signupEmail}"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Мы отправили вам волшебную ссылку для входа в ваш аккаунт."
-
msgid "Webhook"
msgstr "Вебхук"
diff --git a/packages/locale/locales/ru/mes.po b/packages/locale/locales/ru/mes.po
index 669bfa7310..04f8c35147 100644
--- a/packages/locale/locales/ru/mes.po
+++ b/packages/locale/locales/ru/mes.po
@@ -1862,6 +1862,9 @@ msgstr "Перемешать"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Войдите с помощью биометрии вместо волшебной ссылки. Ключи доступа защищены с помощью Face ID, Touch ID или PIN вашего устройства."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Войти через Google"
@@ -1880,6 +1883,9 @@ msgstr "Выйти"
msgid "Sign out instead"
msgstr "Вместо этого выйдите"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Signed in as {stationName}"
msgstr "Вход выполнен как {stationName}"
@@ -2230,8 +2236,8 @@ msgstr "Просмотреть заявку на техобслуживание"
msgid "View or open"
msgstr "Просмотр или открытие"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Мы отправили вам ссылку для входа в ваш аккаунт."
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
msgid "What is {translatedTerm}?"
msgstr "Что такое {translatedTerm}?"
diff --git a/packages/locale/locales/tr/erp.po b/packages/locale/locales/tr/erp.po
index 2c809b04c1..5420d056ee 100644
--- a/packages/locale/locales/tr/erp.po
+++ b/packages/locale/locales/tr/erp.po
@@ -16027,6 +16027,9 @@ msgstr "Ramp entegrasyonunu açın ve kurulumu tamamlamak için yeniden bağlanm
msgid "Open the Setup Map"
msgstr "Kurulum Haritasını Aç"
+msgid "Open this link in the browser where you asked to sign in, or enter the 6-digit code from the email there."
+msgstr ""
+
msgid "Open transactions"
msgstr "Açık işlemler"
@@ -21373,12 +21376,18 @@ msgstr "Bu kural başarısız olduğunda kullanıcıya gösterilir."
msgid "Shuffle"
msgstr "Karıştır"
+msgid "Sign in here instead"
+msgstr ""
+
msgid "Sign in to Carbon"
msgstr "Carbon'a giriş yapın"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Sihirli bağlantı yerine biyometrik kimlik doğrulama ile oturum açın. Geçiş Anahtarları Face ID, Touch ID veya cihaz PIN'iniz tarafından korunur."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Google ile giriş yap"
@@ -21397,6 +21406,9 @@ msgstr "Oturumu Kapat"
msgid "Sign out instead"
msgstr "Bunun yerine Oturumu Kapat"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Sign-off review before moving to the next step"
msgstr "Bir sonraki adıma geçmeden önce onay incelemesi"
@@ -26097,15 +26109,15 @@ msgstr "Her sütunu otomatik olarak eşleştirdik. Devam etmeden önce aşağıd
msgid "We triage and fix issues fast while your team settles in"
msgstr "Sorunları hızlı bir şekilde sınıflandırıp çözeriz ve ekibiniz sisteme alışırken yanınızdayız"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
+
msgid "We've sent a verification code to {email}"
msgstr "Doğrulama kodunu {email} adresine gönderdik"
msgid "We've sent a verification code to {signupEmail}"
msgstr "Doğrulama kodunu {signupEmail}'e gönderdik"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Hesabınıza giriş yapmak için size bir sihirli bağlantı gönderdik."
-
msgid "Webhook"
msgstr "Webhook"
diff --git a/packages/locale/locales/tr/mes.po b/packages/locale/locales/tr/mes.po
index 8aba09424d..da40aa185d 100644
--- a/packages/locale/locales/tr/mes.po
+++ b/packages/locale/locales/tr/mes.po
@@ -1862,6 +1862,9 @@ msgstr "Karıştır"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "Sihirli bir bağlantı yerine biyometrik veriler ile oturum açın. Geçiş anahtarları Face ID, Touch ID veya cihaz PIN'iniz tarafından korunur."
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "Google ile giriş yap"
@@ -1880,6 +1883,9 @@ msgstr "Oturumu Kapat"
msgid "Sign out instead"
msgstr "Bunun yerine oturumu kapat"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Signed in as {stationName}"
msgstr "Oturum açıldı olarak {stationName}"
@@ -2230,8 +2236,8 @@ msgstr "Bakım emrini Görüntüle"
msgid "View or open"
msgstr "Görüntüle veya aç"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "Hesabınıza giriş yapmak için size bir sihirli bağlantı gönderdik."
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
msgid "What is {translatedTerm}?"
msgstr "{translatedTerm} nedir?"
diff --git a/packages/locale/locales/zh/erp.po b/packages/locale/locales/zh/erp.po
index c23428b833..2d40a93464 100644
--- a/packages/locale/locales/zh/erp.po
+++ b/packages/locale/locales/zh/erp.po
@@ -16027,6 +16027,9 @@ msgstr "打开 Ramp 集成,然后重新连接以完成配置。"
msgid "Open the Setup Map"
msgstr "打开设置地图"
+msgid "Open this link in the browser where you asked to sign in, or enter the 6-digit code from the email there."
+msgstr ""
+
msgid "Open transactions"
msgstr "未结交易"
@@ -21373,12 +21376,18 @@ msgstr "当此规则失败时向用户显示。"
msgid "Shuffle"
msgstr "随机"
+msgid "Sign in here instead"
+msgstr ""
+
msgid "Sign in to Carbon"
msgstr "登录 Carbon"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "使用生物识别而不是魔法链接登录。通行密钥由 Face ID、Touch ID 或您的设备 PIN 保护。"
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "用 Google 登录"
@@ -21397,6 +21406,9 @@ msgstr "登出"
msgid "Sign out instead"
msgstr "改为登出"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Sign-off review before moving to the next step"
msgstr "在进入下一步骤前进行签署评审"
@@ -26097,15 +26109,15 @@ msgstr "我们自动匹配了每一列。继续前请查看下面的值。"
msgid "We triage and fix issues fast while your team settles in"
msgstr "在您的班组适应期间,我们快速分类和修复问题"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
+
msgid "We've sent a verification code to {email}"
msgstr "我们已向 {email} 发送了验证码"
msgid "We've sent a verification code to {signupEmail}"
msgstr "我们已向 {signupEmail} 发送了验证码"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "我们已向您发送了一个魔法链接以登录您的账户。"
-
msgid "Webhook"
msgstr "Webhook"
diff --git a/packages/locale/locales/zh/mes.po b/packages/locale/locales/zh/mes.po
index 8f4c7b0bf0..91c80a60af 100644
--- a/packages/locale/locales/zh/mes.po
+++ b/packages/locale/locales/zh/mes.po
@@ -1862,6 +1862,9 @@ msgstr "随机生成"
msgid "Sign in with biometrics instead of a magic link. Passkeys are secured by Face ID, Touch ID, or your device PIN."
msgstr "使用生物识别功能而非魔法链接登录。通行密钥由 Face ID、Touch ID 或设备 PIN 保护。"
+msgid "Sign in with code"
+msgstr ""
+
msgid "Sign in with Google"
msgstr "使用 Google 登录"
@@ -1880,6 +1883,9 @@ msgstr "退出登录"
msgid "Sign out instead"
msgstr "改为登出"
+msgid "Sign-in code"
+msgstr ""
+
msgid "Signed in as {stationName}"
msgstr "已登录为 {stationName}"
@@ -2230,8 +2236,8 @@ msgstr "查看维护工单"
msgid "View or open"
msgstr "查看或打开"
-msgid "We've sent you a magic link to sign in to your account."
-msgstr "我们已向您发送了登录链接,请查收。"
+msgid "We've emailed you a sign-in link and a 6-digit code. Follow the link, or enter the code here."
+msgstr ""
msgid "What is {translatedTerm}?"
msgstr "{translatedTerm}是什么?"