Hi Supabase! I'm currently trying to work out auth...
# javascript
d
Hi Supabase! I'm currently trying to work out auth, and I'm trying to do something like this on sign in:
Copy code
js
const { error } = await supabase.auth.signIn(
  {
    provider: "github",
  },
  {
    redirectTo: `http://localhost:3000${window.location.pathname}${window.location.search}${window.location.hash}`,
  }
);
The problem is that it always redirects to my main page I specified in the dashboard's Settings.
http://localhost:3000
is whitelisted in my dashboard's settings, however, it only works if it's only
http://localhost:3000
and nothing else, such as
http://localhost:3000/...
. The only other solution I found is to do
?redirect=http://localhost:3000/...
and handle the redirect myself. However, I found this not ideal as I have my sign in component in my navbar.
Edit: the "workaround" doesn't actually work. 😦
s
The redirectTo URL must match exactly what you put inside of your Additional URL inside of the Supabase Dashboard
d
So I need to include every page of my website in the settings?
s
Yes if you are deciding the redirecting to every page on your website
d
Alright, thanks. I'm also exploring storing the values in local storage/cookies instead and redirect it there.
I worked that out, thanks