We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b9706c commit 354a364Copy full SHA for 354a364
middleware.ts
@@ -1,4 +1,4 @@
1
-import { getAuthStatus, getAuthToken } from "@/lib/auth";
+import { getAuthStatus, OAUTH_CONFIG } from "@/lib/auth";
2
import { NextRequest, NextResponse } from "next/server";
3
4
// Define public routes that don't require authentication
@@ -33,7 +33,7 @@ export async function middleware(request: NextRequest) {
33
return NextResponse.next();
34
}
35
36
- const token = await getAuthToken();
+ const token = request.cookies.get(OAUTH_CONFIG.TOKEN_COOKIE_NAME)?.value ?? null;
37
if (!token) {
38
return unauthorized(request);
39
0 commit comments