© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
20 replies
Budi

Issue with redirect using OAuth with local development

I'm building a SvelteKit app using Supabase SSR and am running a local version of Supabase for development. I have configured the env variables according to the Supabase docs, adding both the local site URL and redirect destionation in
config.toml
config.toml
and my remote db in
.env
.env
to get Supabase SSR working.

supabase/config.toml
supabase/config.toml
: https://github.com/brucey0x/bv_markdown_blog/blob/293ec43410db654d60882e540f1fc2fd2cad9f66/supabase/config.toml

I am triggering a Github login via a form action, which has the redirect url
src/routes/auth/+page.server.ts
src/routes/auth/+page.server.ts
: https://github.com/brucey0x/bv_markdown_blog/blob/293ec43410db654d60882e540f1fc2fd2cad9f66/src/routes/auth/%2Bpage.server.ts

The callback page has a server function defined as
src/routes/auth/callback/+server.ts
src/routes/auth/callback/+server.ts
: https://github.com/brucey0x/bv_markdown_blog/blob/293ec43410db654d60882e540f1fc2fd2cad9f66/src/routes/auth/callback/%2Bserver.ts

Unfortunately, when I trigger the Github signin, I get this error log with a redirect URL that includes the public:

OAuth signin failed:  Redirect {
  status: 303,
  location: 'https://wwznwptvovjbqfyltnza.supabase.co/auth/v1/authorize?provider=github&redirect_to=http%3A%2F%2Flocalhost%3A5173%2Fauth%2Fcallback%3Fnext%3D%2Fadmin&code_challenge=[CODE_CHALLENGE]&code_challenge_method=s256'
}
OAuth signin failed:  Redirect {
  status: 303,
  location: 'https://wwznwptvovjbqfyltnza.supabase.co/auth/v1/authorize?provider=github&redirect_to=http%3A%2F%2Flocalhost%3A5173%2Fauth%2Fcallback%3Fnext%3D%2Fadmin&code_challenge=[CODE_CHALLENGE]&code_challenge_method=s256'
}


I've done the obvious things like
supabase stop && supabase start
supabase stop && supabase start
but can't figure out why it's including my public supabase URL in the url while ALSO including the local redirect.

The
auth?/signin
auth?/signin
request works and returns a 204 success response. But the
src/routes/auth/callback/+server.ts
src/routes/auth/callback/+server.ts
logs aren't trigerring so the page isn't being hit.

Any suggestions? Thank you!
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

OAuth Page Redirect Issue
SupabaseSSupabase / help-and-questions
4y ago
google oauth redirect
SupabaseSSupabase / help-and-questions
4y ago
Google OAuth "Bad request" error on local development with Supabase CLI
SupabaseSSupabase / help-and-questions
8mo ago
OAuth Server with local CLI
SupabaseSSupabase / help-and-questions
2mo ago