You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when you successfully logged in it does redirect to http://tenant1.localhost:3000/ but the page shown is the home page of the platform not the tenant but when you refresh manually you get the home page of the tenant.
I have added a console.log in the middleware.
exportdefaultasyncfunctionmiddleware(req: NextRequest){consturl=req.nextUrl;// Get hostname of request (e.g. demo.vercel.pub, demo.localhost:3000)lethostname=req.headers.get("host")!.replace(".localhost:3000",`.${clientEnv.NEXT_PUBLIC_ROOT_DOMAIN}`);constsearchParams=req.nextUrl.searchParams.toString();// Get the pathname of the request (e.g. /, /about, /blog/first-post)constpath=`${url.pathname}${searchParams.length>0 ? `?${searchParams}` : ""}`;console.log({ hostname, path });//...}
I have a login page in a [domain]/login/page.tsx that calls a server action.
In the login page of a site e.g: http://tenant1.localhost:3000/login
when you successfully logged in it does redirect to http://tenant1.localhost:3000/ but the page shown is the home page of the platform not the tenant but when you refresh manually you get the home page of the tenant.
I have added a console.log in the middleware.
Same log output for redirect("/?test=test") and
redirect('http://tenant1.localhost:3000?test=test')
so it looks like the issue is that redirect in server actions does not care about the subdomain.
Only tested this locally on next v14.2.3
The text was updated successfully, but these errors were encountered: