auth icon indicating copy to clipboard operation
auth copied to clipboard

linkIdentity always redirects to "Site URL" instead of a valid "redirect URL" (web)

Open willsmanley opened this issue 11 months ago • 1 comments

Lets say you run flutter for web and specify port 7357, and in your auth URL settings you list your primary domain at the top as site url (https://primarydomain.com) and then at the bottom in redirect URLs you list your primary domain and local testing URI: (https://primarydomain.com, http://localhost:7357)

flutter run -d chrome --web-port=7357

While window.location.href == 'http://localhost:7357', signInWithOAuth works perfectly. It navigates to consent screen and then right back to http://localhost:7357:

await Supabase.instance.client.auth.signInWithOAuth(OAuthProvider.apple, redirectTo: window.location.href);

However for anonymous users, this linkIdentity always redirects to "Site URL" (the primary domain), even if you specify a valid redirectTo URL that is stored in redirect URLs here:

await Supabase.instance.client.auth.linkIdentity(OAuthProvider.apple, redirectTo: window.location.href);

This is a supabase side issue, not specific to google or apple or other oauth provider.

It's also not really a flutter SDK issue, it is a supabase backend issue (I think) but theres not a general place to open an issue as far as I know.

willsmanley avatar Jan 23 '25 16:01 willsmanley

Facing the same bug.

Did you find a workaround @willsmanley ?

serranoarevalo avatar Mar 28 '25 09:03 serranoarevalo