supabase / supabase-js

An isomorphic Javascript client for Supabase. Query your Supabase database, subscribe to realtime events, upload and download files, browse typescript examples, invoke postgres functions via rpc, invoke supabase edge functions, query pgvector.
https://supabase.com
MIT License
2.86k stars 220 forks source link

after google login stuck on page application not calls getSession #811

Closed okandavut closed 8 months ago

okandavut commented 10 months ago

Bug report

Describe the bug

Hi, I am using google login with simple implementation and 2 days before it started not working after user selects google account it page stuck in application with below url. Actually the reason is getSession method not triggered and session is not set the browser. I checked access token information is valid but I didn't change anything. After updating 2.26.0 it started doing this. I downgraded to 2.4.0 but not works.

http://localhost:5173/#access_token=eyJhbGciOiJIUzI1NiIsImtpZCI6ImdLVWdtWEgzWDdRanhQVzMiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNjkwNDU1MTAwLCJpYXQiOjE2ODk4NTAzMDAsImlzcyI6Imh0dHBzOi8vaHR0cHM6Ly9md2FhcnFkc3hqbnRjeWhpbWtuay5zdXBhYmFzZS5jby9hdXRoL3YxIiwic3ViIjoiYjY2NDBmYTEtMzA0ZS00YjdlLWJhNmItZWUwYzBmYzc4OTE3IiwiZW1haWwiOiJkYXZ1dC5va2FuQGdtYWlsLmNvbSIsInBob25lIjoiIiwiYXBwX21ldGFkYXRhIjp7InByb3ZpZGVyIjoiZW1haWwiLCJwcm92aWRlcnMiOlsiZW1haWwiLCJnb29nbGUiLCJnaXRodWIiXX0sInVzZXJfbWV0YWRhdGEiOnsiYXZhdGFyX3VybCI6Imh0dHBzOi8vbGgzLmdvb2dsZXVzZXJjb250ZW50LmNvbS9hL0FBY0hUdGNqdnlKSXM2SFJoUXFQWXZ2bWp2RHNLak41OXZ4c2FzQkE2MWYtTmxsWnhPMD1zOTYtYyIsImVtYWlsIjoiZGF2dXQub2thbkBnbWFpbC5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiZnVsbF9uYW1lIjoiT2thbiBEQVZVVCIsImlzcyI6Imh0dHBzOi8vYWNjb3VudHMuZ29vZ2xlLmNvbSIsIm5hbWUiOiJPa2FuIERBVlVUIiwicGljdHVyZSI6Imh0dHBzOi8vbGgzLmdvb2dsZXVzZXJjb250ZW50LmNvbS9hL0FBY0hUdGNqdnlKSXM2SFJoUXFQWXZ2bWp2RHNLak41OXZ4c2FzQkE2MWYtTmxsWnhPMD1zOTYtYyIsInByb3ZpZGVyX2lkIjoiMTA4Mzc0NzEyOTU1MTA3Nzc1OTA5Iiwic3ViIjoiMTA4Mzc0NzEyOTU1MTA3Nzc1OTA5In0sInJvbGUiOiJhdXRoZW50aWNhdGVkIiwiYWFsIjoiYWFsMSIsImFtciI6W3sibWV0aG9kIjoib2F1dGgiLCJ0aW1lc3RhbXAiOjE2ODk4NTAzMDB9XSwic2Vzc2lvbl9pZCI6IjM2MWY4MWE5LWZmY2YtNGE1Ni05NzViLTc4MzM3NGIzYzdhZCJ9.1U19f7r-TSA9VjTiQP4Vovnd1AlCuz7pFovt7hpw4sc&expires_in=604800&provider_refresh_token=1%2F%2F09AQRMtQGNgqNCgYIARAAGAkSNwF-L9Ira5xFR18NzO2M9mi62ixWocSiSH06SUCSSYyh082cjLei4aD0xzcK9P7btLIkN3etEds&provider_token=ya29.a0AbVbY6MrOUQbj6HO4M64vKM7FsdJFdWOQoXltySEZkLcV--iSwtSO91x_lg4Y-iD63XUbbMfgDhqyJib8Q58ubb9JdtX_QQebhdR1Tl7Yz5sXwIbvS7WewBXVot0YhSnpm0te9mh8_NpwBbo_cR0PRBlC69_aCgYKAc0SARMSFQFWKvPlfUJRB9xfCnevnoDtmiFnfg0163&refresh_token=GhgurJLmr_xiswoz5fuoGA&token_type=bearer

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to login
  2. Select account
  3. Stuck on the page
  4. See error

Expected behavior

Needs to set session to localstorage and cookie and open page.

Screenshots

image

Code:

signInWithOAuth:

image

App.jsx file:

image image

System information

Additional context

Application is react app + Vite and using TypeScript.

hf commented 10 months ago

Please upgrade to the latest version of gotrue-js.

okandavut commented 10 months ago

I updated and tried before creating the issue. @hf Current version is: "@supabase/gotrue-js": "^2.44.1", "@supabase/supabase-js": "^2.26.0",

I checked package-lock now and can see like this:

image
okandavut commented 10 months ago

Can anyone help about this problem because after install last version I started see errors. Today also updated and you can see in screenshots. @hf do you have any suggestion for me?

meathill commented 10 months ago

I'm facing the same issue. I'm using Nuxt@3.6.1 and @nuxtjs/supabase@0.3.8.

okandavut commented 10 months ago

Used this solution but latest version has problems.

https://github.com/supabase/supabase/issues/15930#issuecomment-1645861712

nddr commented 10 months ago

Having the same issue with Nuxt@3.6.5 and @nuxtjs/supabase@0.3.8

hf commented 9 months ago

Hey folks! Sorry about these issues. Please roll back to any version that worked for you.

We're tracking the fix in this issue: https://github.com/supabase/supabase/issues/15930

kangmingtay commented 8 months ago

hey everyone, we're gonna close this since the issue has been resolved as mentioned in https://github.com/supabase/supabase/issues/15930