-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supabase auth (google) not working properly #15930
Comments
I have had the same problem. My app stopped working since last night. It shows a blank page when redirecting from google. However, when I use Firefox and open dev tools it works. it's so weird. |
Possibly related. Or just a coincidence. |
I have a same error also, i'm using Nuxt3(latest) you can show this problem, my side project.. |
I agree with @mallahyari, works on Firefox but not Chrome, weird. |
Not really up on this but... You mention works on Firefox and not Chrome. Is it possible you were running on Chrome, upgraded, or got upgraded and then it stopped. Then went to Firefox with the "new versions" or a clean slate? Maybe some local storage/cookie thing from an old version to new? Just speculating. |
It was working. But all of a sudden since last night it stopped. I haven't updated Chrome or Firefox last couple of days. I even tested on Safari and Edge and it doesn't work, the same blank page appears. Even in Firefox, you have open "dev tools" otherwise it doesn't work. That's weird and frustrating, because my whole app depends on it. I am looking to replace Supabase with another platform. |
@mallahyari that is more detail... I was mainly thinking along the lines of the supabase code updating and why one browser would work and another not. Not upgrade of the browser itself. But instead some data stored in the browser not being compatible between Supabase code updates. But I'm just throwing out ideas as a spectator. |
@GaryAustin1 I understand and thank you for the ideas. They might help anyway. I have dug Chrome even service workers, indexedDb, etc, just to realize what's going on and why it happens. But nothing. |
I've tried an older version of supabase SDK (v1.35.7). This seems to work on chrome. But the latest version of the SDK doesn't work. |
I am also having the same error with the twitch provider. |
I think our problems are same #811 and facing same problem. I tried downgrading the supabase-js version but not working. |
Totally the same issue. It works on firefox dev tools opened. Other browsers don't work. |
@okandavut me too!! exactly same problem.. i'm use |
Same here, the login works only when dev tools opened (tried only on firefox). PS : this happens only with OAuth, with email/password method, there are no problems. |
I had the problem that "pnpm": {
"overrides": {
"@supabase/gotrue-js": "2.43.1"
}
} Found this here: nuxt-modules/supabase#207 |
Thanks @piscis, there was a big change in 2.44.0. I can't test until next week, but hopefully someone else can. |
I've got the same issue on next JS 13.4 - more detail here. Strange that the dev / production distinction is related. |
But I am not using Nuxt actually I am using React app + Vite and I can't manually downgrade go-truejs |
Setting an override in your package.json should still work to effectively "downgrade" the gotrue-js version. Afterwards, you'd need to |
After additional tests it turns out that mobile safari does not like gotrue-js version So to solve the issue of unsupported stack guards ( "pnpm": {
"overrides": {
"@supabase/supabase-js": "2.24.0",
"@supabase/gotrue-js": "2.38.0"
}
} At least this seems to work for our mobile users as well as for the desktop clients. |
anyone else getting: "Application error: a client-side exception has occurred (see the browser console for more information)." when using these fixes? It will work for a bit and then I get this error. I also see in my console: |
@evelynf |
@evelynf @yeonjulee1005 this is not the same issue as the original post. I'd recommend creating an issue on the gotrue-js repo and asking for clarification about what the warning means. |
@rajan-personal you have to provide callback url like this
you will get the code on /auth/v1/callback/route.tsx as query params. you have to exchange that code |
@MickyRajkumar I am using dart and tried same. It is redirecting to supabase admin page directly after google. User is redirected to google and he is not coming back to application. The callback is taking directly to supabase admin page. |
is this your supabase admin page https://api.mysave.app/? |
Yeah.. I tried. |
I want to know whats the most stable version for supabase. |
Thanks, that got me thinking in the right direction. My issues was that authentication was going through just fine (locally using supabase docker sdk), but no session was set. const handleAuthGoogle = async () => {
SupabaseBrowserClient.auth.signInWithOAuth({
provider: "google",
options: {
redirectTo: `${location.origin}/api/auth/callback`, <---- points to my app's directory endpoint where i change code for session (from email authentication implementation )
},
});
}; |
I'm facing the same issue. vue SPA (no SSR). My app will get stuck exactly as described in the first post of this issue. Glad I found this report to learn it can be workaround by fixating the version of gotrue-js and supabase-js "dependencies": {
"@supabase/supabase-js": "2.36.0",
},
"overrides": {
"@supabase/gotrue-js": "2.44.0"
}, |
Can you be specific on what is like the first post. Not clear from it what is meant by getSession does not return anything. Do you make the getSession call and it never returns? |
I'm calling async function handleOAuthLoginGithub() {
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'github',
options: {
redirectTo: 'http://localhost:8080/#/account',
} })
if (error) console.error('Error: ', error.message)
console.log(data)
} the redirection process kicks off, redirection to gihub, than back again to the redirectUrl in my vue app. When it is not working (i.e. with recent supabase-js/gotrue-js version) the redirectUrl is called with added #access_token=eyJhbGci…&refresh_token=psVOeU…DNT2o2VA&token_type=bearer and get stuck at this point. i.e. the url is not cleaned up, the Fixating the version as I described makes the problem go away (with no changes to the code, supabase configuration, auth provider configuration etc) In this case again a 302 redirect happens to the redirectUrl with added tokens in the same manner but now the url get processed and parameters are removed. |
@volkerp Thanks. That is not in line with the other issue I was worried you might be encountering based on getSession actually returning. It was not clear if it was returning null or not returning based on the OPs original post. There is an issue that locks up the next supabase request IF you do a supabase call in the onAuthStateChange handler. |
I'm not sure if this can help some but I was stuck with this issue (
So I just removed router.push( '/panel'); and it worked back again. For some reason it worked well on Chrome, but it failed on Safari / Webkit. |
Everyone's talking about redirectTo |
Hello, I am having similar issues as this closed issue. I have an NextJS 14 app with email + password login, and I wanted to add Oauth into the mix. I am running all the login logic on Server Actions. Currently on a The server action being used:
Here are my dependencies:
When I get redirected back to my app, both I ask, do I need For more context, I followed the official Supabase instructions |
No, you shouldn't need to separately install Have you tried the instructions that are specific to Server-Side Auth? With |
hello, I didn't noticed those instructions. Thx. 👍🏼 . I will read them and take the appropriate steps. UPDATE: it works, yay. Supabase should make a note or something on the Login with Google instructions; in my opinion 😇 . Regardless, thanks @charislam for pointing me to the right direction 💪🏼 . |
I'm having the same issue with google and twitter signin. No error logs, no issues in the authentication flow, but nothing happens after redirect. The session object is always empty. Also, interestingly, it only happens on vercel. I deployed the same commit and same .env on digitalocean and it works just fine. Probably something to do with serverless in my case. Still figuring it out |
I’m facing the same issue as you but with cloudflare. In my local env it works perfectly fine (linked to my remote db). Have you found any solution yet ? |
Finally found a solution ! |
Had similar issue. Fixed it by changing |
This bug is so unbelievable .
Event after redirect from google is never changed to SIGNED_IN and session is just null.
|
I came from "@supabase/supabase-js": "2.39.8", this should not be closed. |
its still an issue |
same here |
This strange bug made me refactor my entire app to Nextjs. It seems supabase only focuses on implementation in Nextjs. Everything in theory should work in regular React but in reality, it just does not work. After switching to Nextjs, I never experienced this problem again. supabaseClient.auth.onAuthStateChange((event, session) => { console.log('first', event, session) return () => authListener.subscription.unsubscribe() }, [] The event is always properly set as "SIGNED_IN". This WAS NOT the case in my old React app. I have not changed any setting in GoogleSignIn. At some point, you just have to bite the bullet and go with Supabase's decision. (NextJs). |
This bug is because supabase supports mainly hash router |
The latest version still only works in Firefox. On Chrome it gets stuck and never fires the |
I think i actually found the bug after some hours digging though it... The reason is that when Supabase Auth redirects to https://lovguiden.ai/api/auth/callback, since I specified this, Vercel domain control then in return redirects me to https://www.lovguiden.ai/ but without the "api/auth/callback" so I would always end up on the root page... I changed my Redirect urls on supabase to https://www.lovguiden.ai/ and now it works as expected using:
and the /api/auth/callback
This was awful to figure out.............. |
I was facing similar issues. In case anyone else has this issue, double-check that when you're trying to use the PKCE flow you create a Supabase client with |
did you use react? or next? |
Still got this issue, it's so annoying |
Bug report
Describe the bug
I've implement the supabase auth with google provider in a create-react-app enviroment. Now when i go through the signin process it redirects me to localhost with token instade of signin me in.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Bootstrap CRA and implement supabase auth
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
Initial Page
This is after is signed in with, it just sent me session information in url hast. But doesn't actually log me in.
I'm trying to get the user session but it doesn't returns anything.
If applicable, add screenshots to help explain your problem.
System information
One thing i've tried the same with Nextjs it worked fine. I'm not sure what is the issue here.
The text was updated successfully, but these errors were encountered: