Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fix: even more debugging for custom domain
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiejaoude committed Nov 6, 2023
1 parent 2211e1c commit 464c84b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export async function middleware(req) {
const adminRequired = ["/admin", "/api/admin"];
const adminUsers = process.env.ADMIN_USERS.split(",");

console.log(`domain used "${hostname}" with path "${reqPathName}"`);
console.log(
`domain used "${hostname}" with path "${reqPathName}"`,
`Request Url "${req.url}"`,
`Req nextUrl "${req.nextUrl.host}"`,
);
// if custom domain + on root path
if (hostname !== req.nextUrl.host && reqPathName === "/") {
console.log(`custom domain used: "${hostname}"`);
Expand Down

0 comments on commit 464c84b

Please sign in to comment.