Why did baseUrl get deprecated? #4466
Unanswered
leo-petrucci
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It's pretty common for a lot of applications to have a single API (api.myapp.com) but multiple frontends that consume it (app.myapp.com, admin.myapp.com, etc.).
In Next-Auth v3 I could set
baseUrl
on SessionProvider (The type is actually still there for some reason) so that separate frontends could share the same session.As of v4 this is not the case anymore, The session provider will always fetch a relative path wherever the app is running.
To fix this I've had to copy the entirety of
SessionProvider
+useSession
into my own codebase to allow to change the above to:It works, but it seems silly not give people the option to do this by default? The change is non breaking as the prop is optional.
Is there a reason why it was removed or would you accept a PR?
Beta Was this translation helpful? Give feedback.
All reactions