Skip to content

Commit 68de4e9

Browse files
fix tutorials
1 parent 048e79c commit 68de4e9

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

pages/tutorials/github-oauth/nextjs.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Create an Route Handlers in `app/login/github/route.ts`. Generate a new state an
7373
```ts
7474
// app/login/github/route.ts
7575
import { generateState } from "arctic";
76-
import { github } from "../../../lib/auth";
76+
import { github } from "@/lib/oauth";
7777
import { cookies } from "next/headers";
7878

7979
export async function GET(): Promise<Response> {
@@ -171,11 +171,6 @@ export async function GET(request: Request): Promise<Response> {
171171
}
172172
});
173173
}
174-
175-
interface GitHubUser {
176-
id: string;
177-
login: string;
178-
}
179174
```
180175

181176
## Validate requests

pages/tutorials/google-oauth/astro.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ import type { APIContext } from "astro";
8282
export async function GET(context: APIContext): Promise<Response> {
8383
const state = generateState();
8484
const codeVerifier = generateCodeVerifier();
85-
const url = await google.createAuthorizationURL(state, codeVerifier, ["openid", "profile"]);
85+
const url = google.createAuthorizationURL(state, codeVerifier, ["openid", "profile"]);
8686

8787
context.cookies.set("google_oauth_state", state, {
8888
path: "/",
@@ -174,7 +174,7 @@ if (Astro.locals.user === null) {
174174
return Astro.redirect("/login");
175175
}
176176

177-
const username = Astro.locals.user.name;
177+
const user = Astro.locals.user;
178178
```
179179

180180
## Sign out

pages/tutorials/google-oauth/sveltekit.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ import type { RequestEvent } from "@sveltejs/kit";
7474
export async function GET(event: RequestEvent): Promise<Response> {
7575
const state = generateState();
7676
const codeVerifier = generateCodeVerifier();
77-
const url = await google.createAuthorizationURL(state, codeVerifier, ["openid", "profile"]);
77+
const url = google.createAuthorizationURL(state, codeVerifier, ["openid", "profile"]);
7878

7979
event.cookies.set("google_oauth_state", state, {
8080
path: "/",

0 commit comments

Comments
 (0)