Skip to content

Commit aae6133

Browse files
fix sveltekit code
1 parent 8580d47 commit aae6133

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pages/tutorials/github-oauth/sveltekit.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ Initialize the GitHub provider with the client ID and secret.
4646

4747
```ts
4848
import { GitHub } from "arctic";
49+
import { GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET } from "$env/static/private";
4950

50-
export const github = new GitHub(import.meta.env.GITHUB_CLIENT_ID, import.meta.env.GITHUB_CLIENT_SECRET, null);
51+
export const github = new GitHub(GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, null);
5152
```
5253

5354
## Sign in page
@@ -83,7 +84,12 @@ export async function GET(event: RequestEvent): Promise<Response> {
8384
sameSite: "lax"
8485
});
8586

86-
redirect(302, url.toString());
87+
return new Response(null, {
88+
status: 302,
89+
headers: {
90+
Location: url.toString()
91+
}
92+
});
8793
}
8894
```
8995

0 commit comments

Comments
 (0)