sveltekit-email-password auth example session fails when running vite as non-localhost
When I run the auth helper example called sveltekit-email-password it works fine when accessing vite as localhost or 127.0.0.1.
But when I add "dev": "vite dev --port 3001 --host 0.0.0.0 " to package.json so that vite binds to a real IP address, the example runs but on each sussessful login the session is reset to null. This only happens when accessing dev site from an IP address.
Supabase backend shows authenticated correctly. No errors on the svelte front end. The problem happens when authentication is sussesful and sveltekit redirects to /dashboard. Could invalidate be erasing the session when accessing from an IP address?
Maybe the layout It seems the root +layout.svelte is removing the session with supabaseClient.auth.onAuthStateChange(() => {invalidate('supabase:auth');}
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.