yea
This commit is contained in:
parent
f84da2f69a
commit
e2bee89d22
|
@ -6,10 +6,6 @@ import { commitSession } from "~/sessions";
|
|||
|
||||
export async function loader({ request }) {
|
||||
const session = await getSession(request.headers.get("Cookie"));
|
||||
if (session.has("userId")) {
|
||||
return redirect("/");
|
||||
}
|
||||
|
||||
const url = new URL(request.url);
|
||||
|
||||
try {
|
||||
|
@ -18,6 +14,10 @@ export async function loader({ request }) {
|
|||
throw new Error("state mismatch");
|
||||
}
|
||||
|
||||
if (session.has("userId")) {
|
||||
return redirect("/");
|
||||
}
|
||||
|
||||
const code = url.searchParams.get("code");
|
||||
if (!code) return redirect("/");
|
||||
|
||||
|
|
Loading…
Reference in New Issue