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
Can you tell me a bit more about your use case? In what circumstances would your middleware not be on the same domain as the /login and /callback routes.
Also, apologies for late replies - I'm away at the moment.
As a workaround for the time being you can use getSession to create your own middleware.
Hi! I actually have two apps on the same domain; the second app is under the basePath.
Login and callback are on both apps and function fine. The variables are also shared. The only problem is, going to the subapp unauthenticated will redirect you to the main app (then you login and end up on the main app).
I was able to work around this by adding an extra returnTo:
Hi @pstoica - please continue to use your workaround. I don't want to change the default base url handling for the middleware - but I'll continue to monitor this use case in case we need to make something configurable
Checklist
Description
I have a
basePath
configured on my project which interferes with the middleware function'sreturnTo
:nextjs-auth0/src/helpers/with-middleware-auth-required.ts
Line 73 in 9388372
This doesn't look configurable as it's always using the
pathname
of the request, which omits thebasePath
.Reproduction
basePath
withMiddlewareAuthRequired
/
, not/:basePath
SDK version
2.2.1
Next.js version
12.3.3
Node.js version
17.8.0
The text was updated successfully, but these errors were encountered: