You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
asyncfunctionsetUserStore(newUser: User|null){console.log("Updating user state",newUser);user.value=newUser;if(newUser){constfetchedProfile=awaituseProfileService().fetchProfile(newUser);setProfileStore(fetchedProfile);}else{setProfileStore({});}}
Bug:
When the user changes very quickly, and supabase's response times are slow, then this can happen:
User changes to Jane
We start fetching the profile (!!!)
Jane logs out, thus the user changes to null
We set the profile to empty
Supabase returns the profile that we tried to fetch a while ago...and now we have a logged out user, with the profile of Jane
The text was updated successfully, but these errors were encountered:
Dang - this is an actual vulnerability (although not much harm could be done by logging users out randomly I suppose - except denial of service in a way).
This has a bug, can you spot it?
Bug:
When the user changes very quickly, and supabase's response times are slow, then this can happen:
The text was updated successfully, but these errors were encountered: