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');}
Why would http://localhost:3000 work and http://real_ip_address:3000 for successful logins not work?
Am I missing something obvious or is there a bug in the auth-helper example?
Thanks for any idea. This has been driving me crazy.
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');}
Why would http://localhost:3000 work and http://real_ip_address:3000 for successful logins not work?
Am I missing something obvious or is there a bug in the auth-helper example?
Thanks for any idea. This has been driving me crazy.