I recently deployed my website on Cloudflare Pages, and I’m encountering an issue with the Supabase login functionality. Prior to deployment on Cloudflare pages I deployed on Vercel, where it worked fine. Everything was working fine in my local development environment. However, after deploying the site on Cloudflare Pages, the login feature is not functioning as expected. The Register and password change feature is working fine.
When attempting to log in using Email and Password, the login process doesn’t proceed further and I have this error in the console:
POST https://marbleture.com/api/_supabase/session 405 s @ entry.e09ba552.js:1 i @ entry.e09ba552.js:1 cl @ entry.e09ba552.js:9 (anonymous) @ entry.e09ba552.js:9 (anonymous) @ entry.e09ba552.js:9 (anonymous) @ entry.e09ba552.js:8 Z @ entry.e09ba552.js:8 (anonymous) @ entry.e09ba552.js:9 (anonymous) @ entry.e09ba552.js:9 (anonymous) @ entry.e09ba552.js:8 Z @ entry.e09ba552.js:8 _notifyAllSubscribers @ entry.e09ba552.js:9 (anonymous) @ entry.e09ba552.js:9 a @ entry.e09ba552.js:8 Promise.then (async) c @ entry.e09ba552.js:8 a @ entry.e09ba552.js:8 Promise.then (async) c @ entry.e09ba552.js:8 a @ entry.e09ba552.js:8 Promise.then (async) c @ entry.e09ba552.js:8 (anonymous) @ entry.e09ba552.js:8 Z @ entry.e09ba552.js:8 signInWithPassword @ entry.e09ba552.js:9 g @ login.3b69d62f.js:1 (anonymous) @ entry.e09ba552.js:1 Bt @ entry.e09ba552.js:1 at @ entry.e09ba552.js:1 r @ entry.e09ba552.js:1 c @ VM15 rocket-loader.min.js:1 entry.e09ba552.js:9 FetchError: (405 (/api/_supabase/session)) at async i (entry.e09ba552.js:1:82005) at async Object.callback (entry.e09ba552.js:9:31508)
I’ve configured Supabase with the appropriate SUPABASE_URL and SUPABASE_KEY, and it was working correctly before deployment.
The Supabase setup and login functionality were tested thoroughly in my local development environment, and I encountered no issues.
I deployed my website on Cloudflare Pages using their standard deployment process.
The website is built with Nuxt3 and utilizes Supabase for authentication and database functionality.
I have followed the Cloudflare Pages documentation and reviewed any specific guidelines provided by Supabase regarding deployment, but the login issue persists.
Verified that the Supabase configuration and credentials (SUPABASE_URL and SUPABASE_KEY) are correctly set in the Cloudflare Pages environment variables.
Checked the network requests and browser console for any error messages or warnings related to the Supabase login process and no other error was seen except the one I shared above.
I expect the Supabase login functionality to work correctly after deploying my website on Cloudflare Pages, just as it did in my local development environment and on Vercel.
Has anyone encountered a similar issue with Supabase authentication after deploying a website on Cloudflare Pages? Are there any specific configurations or settings that need to be adjusted when using Supabase in conjunction with Cloudflare Pages?
Here is the website I am facing challenges with: https://marbleture.com/
I would greatly appreciate any guidance or insights from the community to help resolve this issue.
Thank you in advance for your assistance!