-
Notifications
You must be signed in to change notification settings - Fork 540
Description
Describe the bug
Describe the bug
When using signInWithSSO, the redirectTo option is ignored. Instead of redirecting to the provided URL, the user is redirected to the URL configured in the Supabase dashboard or in config.toml.
According to the documentation, the redirectTo parameter should determine where the user is redirected after authentication. This works correctly for signInWithOAuth, but not for signInWithSSO.
To Reproduce
Steps to reproduce the behavior:
- Call
signInWithSSOwith aredirectToparameter. - Observe that the payload sent to
/auth/v1/ssocorrectly contains theredirect_tofield. - After authentication, the redirect goes to the default dashboard/config URL instead of the provided one.
Payload that gets sent correctly has redirect_to not sure what skip http redirect does but Supabase js includes that in the payload as well?
{
"code_challenge": null,
"code_challenge_method": null,
"provider_id": "*******",
"redirect_to": "https://app.***.nl/foo/bar",
"skip_http_redirect": true
}The user should be redirected to the URL specified in redirectTo after successful authentication, as is the case with signInWithOAuth. Instead they get sent to the configured url in the dashboard.
Library affected
auth-js
Reproduction
No response
Steps to reproduce
No response
System Info
System:
OS: Windows 11 10.0.26100
CPU: (16) x64 AMD Ryzen 7 7840HS w/ Radeon 780M Graphics
Memory: 2.21 GB / 15.29 GB
Binaries:
Node: 22.18.0 - C:\nvm4w\nodejs\node.EXE
npm: 11.5.2 - C:\nvm4w\nodejs\npm.CMD
pnpm: 10.19.0 - C:\nvm4w\nodejs\pnpm.CMD
Browsers:
Chrome: 142.0.7444.134
Edge: Chromium (139.0.3405.102)
npmPackages:
@supabase/supabase-js: ^2.80.0 => 2.80.0
supabase: ^2.54.11 => 2.54.11Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Supabase JS Library issue and not an issue with the Supabase platform. If it's a Supabase platform related bug, it should likely be reported to supabase/supabase instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.