Skip to content

Commit

Permalink
fix inconsistency
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper committed Oct 12, 2024
1 parent 242e0b2 commit 917a03f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pages/sessions/cookies/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,14 @@ This function can be used in server components, server actions, and route handle
import { redirect } from "next/navigation";

async function Page() {
const { user } = await getCurrentUser();
const { user } = await getCurrentSession();
if (user === null) {
return redirect("/login");
}

async function action() {
"use server";
const { user } = await getCurrentUser();
const { user } = await getCurrentSession();
if (user === null) {
return redirect("/login");
}
Expand Down
6 changes: 3 additions & 3 deletions pages/tutorials/github-oauth/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ export async function GET(request: Request): Promise<Response> {

## Validate requests

Use the `getCurrentUser()` function from the [Session cookies in Next.js](/sessions/cookies/nextjs) page to get the current user and session.
Use the `getCurrentSession()` function from the [Session cookies in Next.js](/sessions/cookies/nextjs) page to get the current user and session.

```tsx
import { redirect } from "next/navigation";
import { getCurrentUser } from "@/lib/session";
import { getCurrentSession } from "@/lib/session";

export default async function Page() {
const { user } = await getCurrentUser();
const { user } = await getCurrentSession();
if (user === null) {
return redirect("/login");
}
Expand Down
6 changes: 3 additions & 3 deletions pages/tutorials/google-oauth/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,14 @@ export async function GET(request: Request): Promise<Response> {

## Validate requests

Use the `getCurrentUser()` function from the [Session cookies in Next.js](/sessions/cookies/nextjs) page to get the current user and session.
Use the `getCurrentSession()` function from the [Session cookies in Next.js](/sessions/cookies/nextjs) page to get the current user and session.

```tsx
import { redirect } from "next/navigation";
import { getCurrentUser } from "@/lib/session";
import { getCurrentSession } from "@/lib/session";

export default async function Page() {
const { user } = await getCurrentUser();
const { user } = await getCurrentSession();
if (user === null) {
return redirect("/login");
}
Expand Down

0 comments on commit 917a03f

Please sign in to comment.