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

Magic links do no longer work from supabase-js@2.39.1 #940

Closed bzuu closed 4 months ago

bzuu commented 4 months ago

Bug report

Describe the bug

After upgrading from supabase-js@2.39.0 to 2.39.1 or 2.39.2 magic email links no longer work. The emails arrive correctly, but when you click on the link you are not logged in. Reverting to supabase-js@2.39.0 and gotrue-js@2.58.0 makes the links work again.

Expected behavior

Magic email links should just work when you click on them

Screenshots

If applicable, add screenshots to help explain your problem.

System information

Additional context

It seems this issue is related to supabase/gotrue-js as when I do not also revert that to 2.58.0 the issue persists.

thetechguyseth commented 4 months ago

Just for some more context. A fresh install of 2.39.2 on Mac OS 14 using Safari does indeed work. Do you happen to have an error message after you click on the link. That would be helpful to track the issue down.

bzuu commented 4 months ago

@thetechguyseth I didn't see any error messages no. I'll try to see if I can come up with a small reproduction example that I can share. It may take a few days however before I can find some time to do it.

farzd commented 4 months ago

working fine for me, usually the culprit is

image
bzuu commented 4 months ago

@farzd I guess the site URL configuration is not the issue as it has not changed. The links were working previously with the old package versions, then broke after the upgrade and are working fine again when I revert those two packages.

bzuu commented 4 months ago

I've spent quite a bit of time now trying to narrow this down. I can reproduce the problem both in my production environment as well as in a local development setting.

Strangely when I slowly remove bits of the application code, the problem at some point disappears and doesn't come back when I revert the changes made. I am starting to suspect this is some kind of weird build order/caching issue in Vite or something.

At this point in time I have not succeeded in isolating it any further. I am closing the issue for now as it is unclear where exactly the problem originates and it cannot be consistently reproduced.