Skip to content

Commit

Permalink
docs: fix cookieStore() to cookieStore in authentication/index.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
notwatermango authored Oct 23, 2024
1 parent fc4cc09 commit a8ce228
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ export async function createSession(userId) {
const session = await encrypt({ userId, expiresAt })
const cookieStore = await cookies()

cookieStore().set('session', session, {
cookieStore.set('session', session, {
httpOnly: true,
secure: true,
expires: expiresAt,
Expand Down Expand Up @@ -751,7 +751,7 @@ export async function updateSession() {
const expires = new Date(Date.now() + 7 * 24 * 60 * 60 * 1000)

const cookieStore = await cookies()
cookieStore().set('session', session, {
cookieStore.set('session', session, {
httpOnly: true,
secure: true,
expires: expires,
Expand Down Expand Up @@ -798,7 +798,7 @@ import { cookies } from 'next/headers'

export async function deleteSession() {
const cookieStore = await cookies()
cookieStore().delete('session')
cookieStore.delete('session')
}
```
Expand All @@ -808,7 +808,7 @@ import { cookies } from 'next/headers'

export async function deleteSession() {
const cookieStore = await cookies()
cookieStore().delete('session')
cookieStore.delete('session')
}
```
Expand Down Expand Up @@ -920,7 +920,7 @@ export async function createSession(id: number) {

// 3. Store the session in cookies for optimistic auth checks
const cookieStore = await cookies()
cookieStore().set('session', session, {
cookieStore.set('session', session, {
httpOnly: true,
secure: true,
expires: expiresAt,
Expand Down Expand Up @@ -955,7 +955,7 @@ export async function createSession(id) {

// 3. Store the session in cookies for optimistic auth checks
const cookieStore = await cookies()
cookieStore().set('session', session, {
cookieStore.set('session', session, {
httpOnly: true,
secure: true,
expires: expiresAt,
Expand Down

0 comments on commit a8ce228

Please # to comment.