You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
run commands below:
pnpm i
pnpm dlx wrangler d1 create replace-with-your-database-name-here
pnpm run -r db:migrate:local
pnpm dev
get to the /signin route and type any email and password to trigger the error from auth.js and open the devtools console to see what it looks like.
Expected behavior
have an easy access to handle the custom error thrown from authorize in frontend
The text was updated successfully, but these errors were encountered:
QingjiaTsang
added
bug
Something isn't working
triage
Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
labels
Jan 8, 2025
QingjiaTsang
changed the title
couldn't handle custom error from authorize in frontend
couldn't handle custom error from authorize in frontend, using Vite, React and Hono.js
Jan 8, 2025
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
The text was updated successfully, but these errors were encountered: