auth helper sveltekit email pass login redirect not working when using IP Address
I am using this auth helper: https://github.com/supabase/auth-helpers/tree/main/examples/sveltekit
When I add "vite dev --port 3000 --host 0.0.0.0 " to package.json to attach to an IP address to test from other local devices the redirect after login fails. But logging in from localhost works fine and it redirects to the dashboard.
In supabase backend settings I added valid redirect URLs thinking that was it but it still does not work.
I tracked down this this piece of code in /(app)/+page.svelte and noted in my console log. Seems data is returned from supabase but all null or empty instead of real user data.
const handleSubmit: SubmitFunction = () => {
loading = true;
return async ({ result }) => {
if (result.type === 'redirect') {
console.log('Redirect Does not work when running from IP Address');
await invalidate('supabase:auth');
} else {
await applyAction(result);
}
loading = false;
};
};
When I add "vite dev --port 3000 --host 0.0.0.0 " to package.json to attach to an IP address to test from other local devices the redirect after login fails. But logging in from localhost works fine and it redirects to the dashboard.
In supabase backend settings I added valid redirect URLs thinking that was it but it still does not work.
I tracked down this this piece of code in /(app)/+page.svelte and noted in my console log. Seems data is returned from supabase but all null or empty instead of real user data.
const handleSubmit: SubmitFunction = () => {
loading = true;
return async ({ result }) => {
if (result.type === 'redirect') {
console.log('Redirect Does not work when running from IP Address');
await invalidate('supabase:auth');
} else {
await applyAction(result);
}
loading = false;
};
};
GitHub
A collection of framework specific Auth utilities for working with Supabase. - auth-helpers/examples/sveltekit at main · supabase/auth-helpers