Stop treating login/save-progress as a 48-character email limit.
The overlay was failing Zod on preset method-card support text attached with the draft; raise that cap, allow RFC-length emails, and drop Back to home from the overlay. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import TextInput from "../../controls/TextInput";
|
||||
import ContentLockup from "../../type/ContentLockup";
|
||||
import Alert from "../Alert";
|
||||
import { requestMagicLink } from "../../../../lib/create/api";
|
||||
import { EMAIL_MAX_LEN } from "../../../../lib/create/isValidCreateFlowSaveEmail";
|
||||
import { buildCreateFlowDraftPayload } from "../../../../lib/create/buildCreateFlowDraftPayload";
|
||||
import { safeInternalPath } from "../../../../lib/safeInternalPath";
|
||||
import {
|
||||
@@ -232,6 +233,7 @@ export default function LoginForm({
|
||||
disabled={submitting}
|
||||
error={Boolean(emailError)}
|
||||
showHelpIcon
|
||||
maxLength={EMAIL_MAX_LEN}
|
||||
/>
|
||||
{emailError ? (
|
||||
<p
|
||||
|
||||
@@ -8,10 +8,8 @@ import {
|
||||
useState,
|
||||
type ReactNode,
|
||||
} from "react";
|
||||
import Link from "next/link";
|
||||
import Login from "../components/modals/Login";
|
||||
import LoginForm from "../components/modals/Login/LoginForm";
|
||||
import { useTranslation } from "./MessagesContext";
|
||||
|
||||
export type AuthModalLoginVariant = "default" | "saveProgress";
|
||||
|
||||
@@ -34,7 +32,6 @@ const AuthModalContext = createContext<AuthModalContextValue | null>(null);
|
||||
export function AuthModalProvider({ children }: { children: ReactNode }) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [opts, setOpts] = useState<OpenLoginOptions>({});
|
||||
const t = useTranslation("pages.login");
|
||||
|
||||
const openLogin = useCallback((o?: OpenLoginOptions) => {
|
||||
setOpts(o ?? {});
|
||||
@@ -62,15 +59,6 @@ export function AuthModalProvider({ children }: { children: ReactNode }) {
|
||||
backdropVariant={backdropVariant}
|
||||
usePortal
|
||||
ariaLabelledBy="login-modal-heading"
|
||||
belowCard={
|
||||
<Link
|
||||
href="/"
|
||||
className="text-small-paragraph text-[var(--color-content-invert-tertiary,#2d2d2d)] text-center hover:opacity-90"
|
||||
onClick={() => closeLogin()}
|
||||
>
|
||||
{t("backToHome")}
|
||||
</Link>
|
||||
}
|
||||
>
|
||||
<LoginForm
|
||||
variant={opts.variant ?? "default"}
|
||||
|
||||
Reference in New Issue
Block a user