getSession returns null on server (_app.js getInitialProps) when using Basic Auth #3863
Unanswered
kmsomebody
asked this question in
Help
Replies: 1 comment 1 reply
-
Hi, I don't have an immediate suggestion, but it sounds like the issue is with your configuration. Some cookies might be swallowed and never make it to the app. We recently added a page about how to secure preview environments though, you might find it useful: https://next-auth.js.org/deployment#example |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Description 🐜
When a site is deployed on a password-protected domain, e.g. using Basic Auth via Apache 2 in my case,
getSession
returnsnull
on the server. Disabling Basic Auth in the Apache configuration gets rid of the problem.This isn't a problem for production environments, but it is for staging environments or beta-deployments, in which case password protection is desirable.
Is this a bug in your own project?
Yes
How to reproduce ☕️
_app.js custom app:
_app.js getInitialProps:
Apache configuration:
Screenshots / Logs 📽
No response
Environment 🖥
Next-Auth version isn't shown, I assume it's because I have it encapsulated in a submodule. It's
4.2.1
.Contributing 🙌🏽
No, I am afraid I cannot help regarding this
Beta Was this translation helpful? Give feedback.
All reactions