© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
26 replies
Lukas

Redirect after login

Hi, I was wondering how I can redirect a user to a certain link when they login with OAuth.
Here's my login code:
<button
onClick={() => supabaseClient.auth.signInWithOAuth({
  provider: "google",
  options: {
    redirectTo: "/settings" //I've tried variations, i.e. http://localhost:3000/settings and localhost:3000/settings.
  },
 })
}
>Log in</button>
<button
onClick={() => supabaseClient.auth.signInWithOAuth({
  provider: "google",
  options: {
    redirectTo: "/settings" //I've tried variations, i.e. http://localhost:3000/settings and localhost:3000/settings.
  },
 })
}
>Log in</button>


Here are my redirect links under auth/url-configuration:
(keep in mind that I'm hoping to just have
http://localhost:3000
http://localhost:3000
and not
http://localhost:3000/settings
http://localhost:3000/settings
)
image.png
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Auth UI does not redirect after login
SupabaseSSupabase / help-and-questions
4y ago
Supabase forces page redirect after oAuth login?
SupabaseSSupabase / help-and-questions
4y ago
getSession() is null after login?
SupabaseSSupabase / help-and-questions
3y ago
getSession() return null after login
SupabaseSSupabase / help-and-questions
4y ago