Closed
Description
I'm working on authentication #108 and noticed an annoyance. When I refresh the page, the first request will be sent as PublicAgent (no agent), and will therefore return a 401 if the resource requires signing in. However, the user will be signed in automatically a fraction later. This would result in the user being signed in, yet staring at an unauthorized
page. He could press the retry button, of course, but that's suboptimal...
So I added some logic in the useResource
hook, which keeps track of the current agent. If the agent changes, re-try fetching the resource. It works pretty well, but it adds quite a bit of logic, and possibly makes performance worse.
I'd like to find a better solution to this.
Metadata
Metadata
Assignees
Labels
No labels