supabase-community / supabase-ui-svelte

Supabase authentication UI for Svelte
https://supabase-ui-svelte.vercel.app
132 stars 23 forks source link

signInWithEmail() functionaility doesnt redirectTo when used in <Auth/> component #16

Open escapingSamsara opened 1 year ago

escapingSamsara commented 1 year ago

Bug report

Describe the bug

The bug/issue I am currently facing is, that the Auth component i use for login and signup doesnt redirect the user after sign-in with email/password. Oddly enough, if i enter the wanted query string into the address bar after sign-in, the user appears to be signed in because i can access his profile

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to 'https://supabase.com/docs/guides/getting-started/tutorials/with-sveltekit'
  2. Follow the description and end up with the finished working Auth example.
  3. Change: view="magic_link" redirectTo={${data.url}/auth/callback} showLinks={false} For: view="sign_in" redirectTo={${data.url}/auth/callback} showLinks={true}
  4. Sign into the account using email and password (after sign-up)

Expected behavior

The behavior that should be expected should include a redirect to the given redirectTo value above after clicking the sign-in button. But nothing happens

Screenshots

not needed to understand the issue

System information

Additional context

magic_link login, as well as login via socials (when added like described in the supabase docs), works and redirects perfectly fine

svickers commented 11 months ago

Seeing the same behavior, any workarounds?

asjir commented 8 months ago

I read through supabase conversation on this issue and this seems to be the intended behaviour. The way to implement it is by listening to auth events