fix and cleanup
This commit is contained in:
parent
74fe12ce1f
commit
7df3c61f08
|
@ -1,9 +0,0 @@
|
|||
import { createCookie } from "@remix-run/node";
|
||||
|
||||
export const OAuthToken = createCookie("token", {
|
||||
domain: "http://localhost:3000",
|
||||
path: "/",
|
||||
maxAge: 604_800,
|
||||
httpOnly: true,
|
||||
secrets: [process.env.COOKIE_SECRET],
|
||||
});
|
|
@ -4,6 +4,7 @@ import { Link, useLoaderData } from "@remix-run/react";
|
|||
import { prisma } from "~/db.server";
|
||||
import { Form } from "@remix-run/react";
|
||||
import { json } from "@remix-run/node";
|
||||
import { redirect } from "@remix-run/node";
|
||||
|
||||
const countys = [
|
||||
"Ahvenanmaa",
|
||||
|
@ -62,9 +63,7 @@ export async function action({ request }) {
|
|||
},
|
||||
});
|
||||
|
||||
return countySubmit
|
||||
? json(countySubmit)
|
||||
: new Error("Something went wrong with creating the user");
|
||||
return countySubmit;
|
||||
}
|
||||
|
||||
export async function loader({ request }) {
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
import { OAuthToken } from "./cookies";
|
||||
import { createCookieSessionStorage } from "@remix-run/node";
|
||||
|
||||
const { getSession, commitSession, destroySession } =
|
||||
createCookieSessionStorage({
|
||||
OAuthToken,
|
||||
cookie: {
|
||||
maxAge: 86400,
|
||||
secrets: [process.env.COOKIE_SECRET],
|
||||
path: "/",
|
||||
secure: true,
|
||||
httpOnly: true,
|
||||
sameSite: "lax",
|
||||
},
|
||||
});
|
||||
|
||||
export { getSession, commitSession, destroySession };
|
||||
|
|
Loading…
Reference in New Issue