docs: update getSessionCookie import in demo and docs (#1534)

This commit is contained in:
Rahul Mishra
2025-02-22 12:58:46 +05:30
committed by GitHub
parent 419a86a773
commit 56b0465e4e
2 changed files with 2 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
import { NextRequest, NextResponse } from "next/server";
import { getSessionCookie } from "better-auth";
import { getSessionCookie } from "better-auth/cookies";
export async function middleware(request: NextRequest) {
const cookies = getSessionCookie(request);

View File

@@ -133,7 +133,7 @@ You can use the `getSessionCookie` helper from Better Auth for this purpose:
```ts
import { NextRequest, NextResponse } from "next/server";
import { getSessionCookie } from "better-auth";
import { getSessionCookie } from "better-auth/cookies";
export async function middleware(request: NextRequest) {
const sessionCookie = getSessionCookie(request); // Optionally pass config as the second argument if cookie name or prefix is customized.