createAndLogin() — ui Function Reference
Architecture documentation for the createAndLogin() function in create-user.ts from the ui codebase.
Entity Profile
Dependency Diagram
graph TD 110063c6_ab8a_ff79_5df8_186b41e9a019["createAndLogin()"] db20f931_84b8_e006_0bc8_794e579c9da5["create-user.ts"] 110063c6_ab8a_ff79_5df8_186b41e9a019 -->|defined in| db20f931_84b8_e006_0bc8_794e579c9da5 style 110063c6_ab8a_ff79_5df8_186b41e9a019 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress/support/create-user.ts lines 15–46
async function createAndLogin(email: string) {
if (!email) {
throw new Error("email required for login");
}
if (!email.endsWith("@example.com")) {
throw new Error("All test emails must end in @example.com");
}
const user = await createUser(email, "myreallystrongpassword");
const response = await createUserSession({
request: new Request("test://test"),
userId: user.id,
remember: false,
redirectTo: "/",
});
const cookieValue = response.headers.get("Set-Cookie");
if (!cookieValue) {
throw new Error("Cookie missing from createUserSession response");
}
const parsedCookie = parse(cookieValue);
// we log it like this so our cypress command can parse it out and set it as
// the cookie value.
console.log(
`
<cookie>
${parsedCookie.__session}
</cookie>
`.trim(),
);
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does createAndLogin() do?
createAndLogin() is a function in the ui codebase, defined in packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress/support/create-user.ts.
Where is createAndLogin() defined?
createAndLogin() is defined in packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress/support/create-user.ts at line 15.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free