Skip to content

Commit 752e49d

Browse files
committed
fix: split server export out of auth.github route
1 parent 4fb9bc8 commit 752e49d

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

apps/webapp/app/routes/auth.github.callback.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { LoaderFunction } from "@remix-run/node";
22
import { authenticator } from "~/services/auth.server";
3-
import { redirectCookie } from "./auth.github";
3+
import { redirectCookie } from "./auth.github.server";
44
import { logger } from "~/services/logger.server";
55

66
export let loader: LoaderFunction = async ({ request }) => {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { createCookie } from "@remix-run/node";
2+
3+
export const redirectCookie = createCookie("redirect-to", {
4+
maxAge: 60 * 60, // 1 hour
5+
httpOnly: true,
6+
});

apps/webapp/app/routes/auth.github.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ActionFunction, LoaderFunction } from "@remix-run/node";
2-
import { createCookie } from "@remix-run/node";
32
import { redirect } from "@remix-run/node";
43
import { authenticator } from "~/services/auth.server";
4+
import { redirectCookie } from "./auth.github.server";
55

66
export let loader: LoaderFunction = () => redirect("/login");
77

@@ -27,8 +27,3 @@ export let action: ActionFunction = async ({ request }) => {
2727
throw error;
2828
}
2929
};
30-
31-
export const redirectCookie = createCookie("redirect-to", {
32-
maxAge: 60 * 60, // 1 hour
33-
httpOnly: true,
34-
});

0 commit comments

Comments
 (0)