This commit is contained in:
NotII
2025-03-23 21:25:37 +00:00
parent dc51901c5c
commit 8d7d9b9e1c
5 changed files with 74 additions and 80 deletions

View File

@@ -10,8 +10,11 @@ export async function middleware(req: NextRequest) {
}
try {
const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/auth/me`, {
method: "GET",
// Need to use a full URL for server-side fetch
const baseUrl = req.nextUrl.origin + '/api';
const res = await fetch(`${baseUrl}/auth/me`, {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,