Endpoints being called 2000+ times on refresh
It's very inconsistent when it happens, but sometimes it will make ~2000 requests.
Relevant code:
It's causing tremendous performance problems, and I'm unsure why it even happens in the first place.


5 Replies
bump. i use better auth in multiple projects and they all seem to have this issue
totally unreproducible, happens randomly. is better auth just broken?
hello :(
i would say there could be some re-render problem in those components, probably not related to the better-auth itself, perhaps some useeffect loop
its happening in 2 of my apps both do not have any useEffect
@bekacru sorry for tagging, but could the issue potentially be with the authclient useListOrganizations/useSession hook implementations? after dealing with this for months, the only documentation I could really find on the topic was this saying "if you prefer not to use the hook...", when the fix for this was to use tanstack query and make my own useSession/useListOrganizations hook implementation.
i believe there is a flaw in the react hooks for the auth client
Basic Usage | Better Auth
Getting started with Better Auth
Hey sorry for getting back to this late
Is there anyway you can provide a reproduction I can take a look?