MCPcopy Create free account
hub / github.com/code-forge-io/Remix-Forge / authRouteFileContent

Function authRouteFileContent

src/auth/authFiles/auth.ts:3–15  ·  view source on GitHub ↗
(config: WorkspaceConfiguration)

Source from the content-addressed store, hash-verified

1import { WorkspaceConfiguration } from "vscode";
2
3export const authRouteFileContent = (config: WorkspaceConfiguration) => {
4 const runtimeDependency = config.get("runtimeDependency") || "@remix-run/node";
5 return [
6 `import type { LoaderFunctionArgs } from "${runtimeDependency}";`,
7 'import { authenticator } from "~/services/auth.server";',
8 "",
9 "export const loader = async ({ request }: LoaderFunctionArgs) => {",
10 " return await authenticator.isAuthenticated(request, {",
11 ' successRedirect: "/dashboard",',
12 " });",
13 "};",
14 ].join("\n");
15};

Callers 1

generateAuthFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected