Replies: 14 comments 1 reply
-
Thanks for opening! Can you confirm a few things to help debug this:
|
Beta Was this translation helpful? Give feedback.
-
I should also mention that the Magic Email Link workflow is working with my own SMTP server, so there is a working login workflow and I have been able to access the database and do some basic testing to make sure one user can't access another users's data, so the API endpoints and
I think so, this is what my current credential callbacks look like. It is currently configured for https, but didn't work when configured with http either. ![]()
Sure, it is inherited from this tutorial to get started.. ![]()
No, I didn't see this page and some of the code looks a bit different. All of these were already configured from the starter project (see above).
Root layout,
Root
|
Beta Was this translation helpful? Give feedback.
-
I have the same issue. I've properly set my 'redirectTo'; it even appears in the URL once on accounts.google.com. I've also properly configured my 'Redirect URLs' in Supase. But no matter what I do, it still redirects me to my Site URL after logging in, no matter what. |
Beta Was this translation helpful? Give feedback.
-
Was having the same issue. Not sure if your issues are the same, but, initially I set my Redirect URLs in Supabase to the full domain + The only way I managed to stop this is to remove the Been working fine ever since. |
Beta Was this translation helpful? Give feedback.
-
I've tried using the
|
Beta Was this translation helpful? Give feedback.
-
@amcelroy I'm not using SveltKit, my app is built on remix. The versions I'm using are: "@supabase/supabase-js": "2.42.1",
"@supabase/ssr": "^0.3.0", |
Beta Was this translation helpful? Give feedback.
-
Been facing the same issue, in my case the wildcard approach does not work, what supabase version you had there? |
Beta Was this translation helpful? Give feedback.
-
Supabase OAuth Setup
Navigate to Authentication -> URL Configuration async function handleSocialLogin() {
alert('handleSocialLogin');
setIsLoading(true);
setError(null);
try {
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'google',
options: {
redirectTo: `${window.location.origin}/api/auth/callback`,
queryParams: {
access_type: 'offline',
prompt: 'consent',
},
},
});
if (error) throw error;
alert(data);
} catch (error) {
console.error('Unexpected error:', error);
setError(`An unexpected error occurred: ${error}`);
} finally {
setIsLoading(false);
} |
Beta Was this translation helpful? Give feedback.
-
I'm experiencing exactly the same issue. @hirayamahiroto thank you for the guide, but it is still not fixing the problem in my case. Update |
Beta Was this translation helpful? Give feedback.
-
To allow all URLs after the domain:
For example,if you set To allow only specific links:
For example:https://example.com/api/auth/callback By adding these individually to the allowlist, you can restrict redirects to only the specified URLs. This approach allows you to balance security and flexibility. Allowing all paths is convenient but increases security risks. On the other hand, allowing only specific URLs is more secure but requires updating the configuration each time you add a new endpoint. Reference: |
Beta Was this translation helpful? Give feedback.
-
Yes it is working now, thank you! |
Beta Was this translation helpful? Give feedback.
-
I had this issue as well. After spending the better part of a weekend trying to debug this, I finally managed to fix it as follows (I use Next.js)
Things are finally working fine, but I honestly think the key here was to create new Google OAuth Credentials. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, due to inactivity on this issue I've moved the issue over to discussions/enhancements. |
Beta Was this translation helpful? Give feedback.
-
I still have this problem. I can't use supabase + svelte + google auth. I think the problem is with supabase as I never get the code |
Beta Was this translation helpful? Give feedback.
-
I think there may be a bug or issue with the
signInWithOAuth
function.Summary: When using
signInWithOAuth
using Google as the provider the tokens aren't being passed to theredirectTo
link, and therefore the server endpoint, on a successful login.Versions: "@supabase/supabase-js": "^2.42", "@supabase/auth-helpers-sveltekit": "^0.12.0"
Steps to reproduce:
+page.svelte
that has the function tied to a button or link:+server.ts
at the callback route. I used this tutorial. Set a breakpoint on theconst code = ...
line.Why I think this is a bug?
Comment out the
redirectTo
line and add anonMount
function to the login page created in step 3:Reload the page and try logging in again. The console should report the URL with the Google OAuth response tokens:

Aren't these tokens supposed to be passed to the
+server.ts
endpoint and exchanged as in the example?I have tried on both Chrome and Firefox using both http and https localhost servers. I have also added the

redirectTo
link to the callback URLs located in the project dashboard.Beta Was this translation helpful? Give feedback.
All reactions