cleanup
This commit is contained in:
@@ -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}`,
|
||||
|
||||
Reference in New Issue
Block a user