-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(errors): do not log authjs message with CredentialsSiginin error #11050
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Ignored Deployments
|
@ndom91 this breaks the logic that redirects these errors to the signin page (see |
Also noticed this, left some more details on this in this comment on the other PR that added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaks types on CredentialsSignin class #11155
@@ -193,7 +193,7 @@ export class InvalidCallbackUrl extends AuthError { | |||
* 1. The user is redirected to the signin page, with `error=CredentialsSignin&code=credentials` in the URL. `code` is configurable. | |||
* 2. If you throw this error in a framework that handles form actions server-side, this error is thrown, instead of redirecting the user, so you'll need to handle. | |||
*/ | |||
export class CredentialsSignin extends SignInError { | |||
export class CredentialsSignin extends Error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaks types on CredentialsSignin #11155
This PR caused a regression and now we are unable to throw custom errors during the sign in mechanism. Is there a plan to address this? I can raise a PR to revert if necessary. |
Thanks for the reminder. Check out my response here: #11155 (comment) I'll take a look at fixing this shortly |
Thank you for the prompt response @ndom91! |
Added a test to avoid regression
* fix(core): revert nextauthjs#11050 Added a test to avoid regression * Update callback.test.ts * Update index.ts
☕️ Reasoning
CredentialsSignin
error to useError
as base classerror.message
when users extend this class for their own signin errorsReplaces #10231
🧢 Checklist
🎫 Affected issues
📌 Resources