couldn't handle custom error from authorize in frontend, using Vite, React and Hono.js #12495
Unanswered
QingjiaTsang
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Environment
node version: v20.13.1
not using nextjs, only vite, react for frontend and honojs for backend
here's the deps:
Reproduction URL
https://github.com/QingjiaTsang/reproduce-authjs-issue
Describe the issue
I have followed the docs guide, but failed.
https://authjs.dev/getting-started/providers/credentials#custom-error-messages
In honojs auth config file, I tried to throw a custom error from authorize:
But it failed to catch that in frontend:
It always prints like this, no matter how I tried the solutions relative to this issue in the github (like creating a custom Error class extended from CredentialsSignin or AuthError), it always can't bring the custom error message out. So I guess those solutions there maybe only work for nextjs, and I'm using vite, React and Honojs, it doesn't have the server side like server action in nextjs.
How to reproduce
Expected behavior
have an easy access to handle the custom error thrown from authorize in frontend
Beta Was this translation helpful? Give feedback.
All reactions