Skip to content

Commit 780979c

Browse files
fix sveltekit github oauth tutorial
1 parent 379b658 commit 780979c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pages/tutorials/github-oauth/sveltekit.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,10 @@ import type { RequestEvent } from "@sveltejs/kit";
7474

7575
export async function GET(event: RequestEvent): Promise<Response> {
7676
const state = generateState();
77-
const url = await github.createAuthorizationURL(state);
77+
const url = github.createAuthorizationURL(state, []);
7878

7979
event.cookies.set("github_oauth_state", state, {
8080
path: "/",
81-
secure: import.meta.env.PROD,
8281
httpOnly: true,
8382
maxAge: 60 * 10,
8483
sameSite: "lax"
@@ -96,7 +95,6 @@ Create an API route in `routes/login/github/callback/+server.ts` to handle the c
9695
// routes/login/github/callback/+server.ts
9796
import { generateSessionToken, createSession, setSessionTokenCookie } from "$lib/server/session";
9897
import { github } from "$lib/server/oauth";
99-
import { OAuth2RequestError } from "arctic";
10098

10199
import type { RequestEvent } from "@sveltejs/kit";
102100
import type { OAuth2Tokens } from "arctic";

0 commit comments

Comments
 (0)