I am aware that caffeine regularly breaks auth flows due to complications with react hooks and timings.
However, this is not the solution:
![]()
I guess this was a bandaid fix, so that the creator can always access the admin functions by clicking the live app link from caffeine. But that’s not a real solution. The auth flow needs to recognize the admin PID regardless of where the site is accessed from.
I gave a prompt on reddit yesterday that fixes the auth flow issues, caffeine produces, this solution above just covers them up and hides them. But I just published an app this morning that has the issue, because my draft app covered it up with this bandaid so i didnt know the issue persisted.
Here is the actual prompt that solves this problem if you have it in your app. I use this prompt all the time because its easy for feature updates (new hooks) to break the timings.
prompt:
double check the auth flow and make sure theres nothing with react and auth flow that is breaking things: —II 2.0 + React is easy to get wrong, and most issues come from state + timing mismatches, not auth itself. The common problems are: Auth state initializes async, but React renders routes before identity is ready Actor creation happens before identity refresh, so calls use anonymous principals Page reloads lose identity until rehydration, causing flicker or broken guards