Replies: 1 comment
-
Seems like this has been fixed (probably not the best way). In current version after |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
Operating System
Linux
Operating System Details
Use Visual Studio Code
Python Version
3.10
Additional Context
After set a bad access_token (mimic an invalid or expired token), the useQuery for 'currentUser' in useAuth hook will get an error when request user to the fastapi backend. But this error is not caught in the hook and can't be caught in a component even if I export the error from the hook.
I have no quick solution here. React Query deprecated onError callback for useQuery. So no quick solution inside the useAuth hook. My walkaround is the separate the readUseMe to its own hood and return the useQuery directly. Then I can check the query state and redirect to the login form, remove bad access_token, etc.
I would love to hear suggestions on how to do the error handling here.
Beta Was this translation helpful? Give feedback.
All reactions