action() — ui Function Reference
Architecture documentation for the action() function in login.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD 6d13ed97_b68a_0071_76c0_5775aa869aca["action()"] 720c9764_389f_05a1_ed4b_747e979f904a["login.tsx"] 6d13ed97_b68a_0071_76c0_5775aa869aca -->|defined in| 720c9764_389f_05a1_ed4b_747e979f904a style 6d13ed97_b68a_0071_76c0_5775aa869aca fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/login.tsx lines 20–63
export const action = async ({ request }: ActionFunctionArgs) => {
const formData = await request.formData();
const email = formData.get("email");
const password = formData.get("password");
const redirectTo = safeRedirect(formData.get("redirectTo"), "/");
const remember = formData.get("remember");
if (!validateEmail(email)) {
return json(
{ errors: { email: "Email is invalid", password: null } },
{ status: 400 },
);
}
if (typeof password !== "string" || password.length === 0) {
return json(
{ errors: { email: null, password: "Password is required" } },
{ status: 400 },
);
}
if (password.length < 8) {
return json(
{ errors: { email: null, password: "Password is too short" } },
{ status: 400 },
);
}
const user = await verifyLogin(email, password);
if (!user) {
return json(
{ errors: { email: "Invalid email or password", password: null } },
{ status: 400 },
);
}
return createUserSession({
redirectTo,
remember: remember === "on" ? true : false,
request,
userId: user.id,
});
};
Domain
Subdomains
Source
Frequently Asked Questions
What does action() do?
action() is a function in the ui codebase, defined in packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/login.tsx.
Where is action() defined?
action() is defined in packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/login.tsx at line 20.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free