Open markdagraca opened 1 year ago
I am having exactly the same issue (but with Discord auth provider)
@markdagraca Have you been able to find a way around this issue? Thanks!
Facing same exact issue. Could it be because Session cookie are stripped from the headers for CDNs. (https://firebase.google.com/docs/hosting/manage-cache#using_cookies)
@markdagraca Have you been able to find a way around this issue? Thanks!
The only work around I have found is to ditch firebase hosting and use cloud run which is much more work
We've also ran into this problem. The setup experience of Next.js + Nextauth + Firebase would be amazingly simple if not for this :(
https://firebase.google.com/docs/hosting/manage-cache#using_cookies
If this is indeed the problem, it would require quite some changes in Nextauth to make it work. Seems Nextauth uses several cookies to work but in Cloud Functions we can only have one, __session
?!
Related discussion: https://github.com/nextauthjs/next-auth/discussions/5301
any workaround for that or progress?
Environment
System: OS: Windows 10 10.0.19045 CPU: (8) x64 Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz Memory: 36.57 GB / 63.94 GB Binaries: Node: 18.16.1 - C:\Program Files\nodejs\node.EXE
npm: 8.3.0 - C:\Program Files\nodejs\npm.CMD Browsers: Chrome: 115.0.5790.171 Edge: Spartan (44.19041.1266.0), Chromium (115.0.1901.203) Internet Explorer: 11.0.19041.1566
Reproduction URL
https://nextauthexample-4e81c.web.app/
Describe the issue
When accessing /api/auth/signin and selecting the Google provider for redirection, the server request hangs, leading to a memory leak issue. This problem also prevents the request from processing when deployed to Google Firebase Hosting, which runs a Cloud Run instance in the background. Notably, the code functions as intended when running on localhost.
Despite the memory continually increasing, no server logs are being produced. This behavior indicates a memory leak issue during data fetching.
I've opened a corresponding issue with the Firebase team for further investigation: Issue #6225.
How to reproduce
Sample Code: GitHub Repository
Steps to Reproduce:
.env
variables.Expected behavior
When deployed to Firebase, the login process should behave the same as it does on localhost, redirecting users to the Google login page without errors. Any attempts to access the page should not result in "Internal Server Error" or "408 Error." The code should function without memory leaks or any server request hang-ups.