Skip to content

Commit

Permalink
fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper committed Oct 7, 2024
1 parent 9cacd30 commit 7ac7ffb
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions pages/tutorials/github-oauth/astro.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ export async function GET(context: APIContext): Promise<Response> {
const existingUser = await getUserFromGitHubId(githubUserId);

if (existingUser !== null) {
const token = generateSessionToken();
const session = await createSession(token, existingUser.id);
setSessionTokenCookie(context, token, session.expiresAt);
const sessionToken = generateSessionToken();
const session = await createSession(sessionToken, existingUser.id);
setSessionTokenCookie(context, sessionToken, session.expiresAt);
return context.redirect("/");
}

Expand All @@ -155,7 +155,7 @@ export async function GET(context: APIContext): Promise<Response> {

const sessionToken = generateSessionToken();
const session = await createSession(sessionToken, user.id);
setSessionTokenCookie(context, token, session.expiresAt);
setSessionTokenCookie(context, sessionToken, session.expiresAt);
return context.redirect("/");
}
```
Expand Down
12 changes: 6 additions & 6 deletions pages/tutorials/github-oauth/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ export async function GET(request: Request): Promise<Response> {
const existingUser = await getUserFromGitHubId(githubUserId);

if (existingUser !== null) {
const token = generateSessionToken();
const session = await createSession(token, existingUser.id);
setSessionTokenCookie(token, session.expiresAt);
const sessionToken = generateSessionToken();
const session = await createSession(sessionToken, existingUser.id);
setSessionTokenCookie(sessionToken, session.expiresAt);
return new Response(null, {
status: 302,
headers: {
Expand All @@ -165,9 +165,9 @@ export async function GET(request: Request): Promise<Response> {
// TODO: Replace this with your own DB query.
const user = await createUser(githubUserId, githubUsername);

const token = generateSessionToken();
const session = await createSession(token, user.id);
setSessionTokenCookie(token, session.expiresAt);
const sessionToken = generateSessionToken();
const session = await createSession(sessionToken, user.id);
setSessionTokenCookie(sessionToken, session.expiresAt);
return new Response(null, {
status: 302,
headers: {
Expand Down
4 changes: 2 additions & 2 deletions pages/tutorials/github-oauth/sveltekit.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export async function GET(event: RequestEvent): Promise<Response> {
if (existingUser) {
const sessionToken = generateSessionToken();
const session = await createSession(sessionToken, user.id);
setSessionTokenCookie(event, token, session.expiresAt);
setSessionTokenCookie(event, sessionToken, session.expiresAt);
return new Response(null, {
status: 302,
headers: {
Expand All @@ -158,7 +158,7 @@ export async function GET(event: RequestEvent): Promise<Response> {

const sessionToken = generateSessionToken();
const session = await createSession(sessionToken, user.id);
setSessionTokenCookie(event, token, session.expiresAt);
setSessionTokenCookie(event, sessionToken, session.expiresAt);

return new Response(null, {
status: 302,
Expand Down
8 changes: 4 additions & 4 deletions pages/tutorials/google-oauth/astro.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ export async function GET(context: APIContext): Promise<Response> {
const existingUser = await getUserFromGoogleId(googleUserId);

if (existingUser !== null) {
const token = generateSessionToken();
const session = await createSession(token, existingUser.id);
setSessionTokenCookie(context, token, session.expiresAt);
const sessionToken = generateSessionToken();
const session = await createSession(sessionToken, existingUser.id);
setSessionTokenCookie(context, sessionToken, session.expiresAt);
return context.redirect("/");
}

Expand All @@ -160,7 +160,7 @@ export async function GET(context: APIContext): Promise<Response> {

const sessionToken = generateSessionToken();
const session = await createSession(sessionToken, user.id);
setSessionTokenCookie(context, token, session.expiresAt);
setSessionTokenCookie(context, sessionToken, session.expiresAt);
return context.redirect("/");
}
```
Expand Down
8 changes: 4 additions & 4 deletions pages/tutorials/google-oauth/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ export async function GET(request: Request): Promise<Response> {
const existingUser = await getUserFromGoogleId(googleUserId);

if (existingUser !== null) {
const token = generateSessionToken();
const session = await createSession(token, existingUser.id);
setSessionTokenCookie(token, session.expiresAt);
const sessionToken = generateSessionToken();
const session = await createSession(sessionToken, existingUser.id);
setSessionTokenCookie(sessionToken, session.expiresAt);
return new Response(null, {
status: 302,
headers: {
Expand All @@ -169,7 +169,7 @@ export async function GET(request: Request): Promise<Response> {

const sessionToken = generateSessionToken();
const session = await createSession(sessionToken, user.id);
setSessionTokenCookie(token, session.expiresAt);
setSessionTokenCookie(sessionToken, session.expiresAt);
return new Response(null, {
status: 302,
headers: {
Expand Down
8 changes: 4 additions & 4 deletions pages/tutorials/google-oauth/sveltekit.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ export async function GET(event: RequestEvent): Promise<Response> {
const existingUser = await getUserFromGoogleId(googleUserId);

if (existingUser !== null) {
const token = generateSessionToken();
const session = await createSession(token, existingUser.id);
setSessionTokenCookie(event, token, session.expiresAt);
const sessionToken = generateSessionToken();
const session = await createSession(sessionToken, existingUser.id);
setSessionTokenCookie(event, sessionToken, session.expiresAt);
return new Response(null, {
status: 302,
headers: {
Expand All @@ -163,7 +163,7 @@ export async function GET(event: RequestEvent): Promise<Response> {

const sessionToken = generateSessionToken();
const session = await createSession(sessionToken, user.id);
setSessionTokenCookie(event, token, session.expiresAt);
setSessionTokenCookie(event, sessionToken, session.expiresAt);
return new Response(null, {
status: 302,
headers: {
Expand Down

0 comments on commit 7ac7ffb

Please sign in to comment.