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