Closed mthadley closed 5 months ago
Seems like this fix breaks NextJS 14.2.3
{ error: 'URL is malformed "/". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls' } GET /auth/callback?code=01HWVQ7E3VPCG0ZCY5ACG9Z0VQ 500 in 379ms
Everything works perfectly with 0.5.1
Could we at least have the option to provide a hostname to the handleAuth
options?
Previously, by cloning the request URL, we were inheriting the
host
and constructing an absolute URL as theLocation
.This is a problem in certain cases, like if the app is running behind a reverse-proxy. From the outside, requests to the proxy may be coming in as
example.com
, but the application may see something else likelocalhost
.We can avoid this by just using whatever was given as the
returnPathname
, or falling back to the default of/
which is a relative URL.