Skip to content

Commit 354a364

Browse files
committed
fix(middleware): use request.cookies
1 parent 2b9706c commit 354a364

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

middleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getAuthStatus, getAuthToken } from "@/lib/auth";
1+
import { getAuthStatus, OAUTH_CONFIG } from "@/lib/auth";
22
import { NextRequest, NextResponse } from "next/server";
33

44
// Define public routes that don't require authentication
@@ -33,7 +33,7 @@ export async function middleware(request: NextRequest) {
3333
return NextResponse.next();
3434
}
3535

36-
const token = await getAuthToken();
36+
const token = request.cookies.get(OAUTH_CONFIG.TOKEN_COOKIE_NAME)?.value ?? null;
3737
if (!token) {
3838
return unauthorized(request);
3939
}

0 commit comments

Comments
 (0)