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
Use consistent error type between doc, logger and error class #5045
Comments
Thanks for the detailed issue reporting, @sato11! 🙌
To be clear, here I suggested throwing
|
Thanks for the info @ThangHuuVu! I've been unaware of it, but yes, I guess that makes sense. I'll be patching it as well in #5046 👍 |
Well, let me pause a bit. Do you even want me to include that in #5046 as well actually, or should that be treated as a different issue? I bet it's kind to add it in the error page as well, since |
@sato11 Let's keep it in a separate issue for better clarity 🙌 |
What is the improvement or update you wish to see?
There is an inconsistent use of two of the error codes,
OAUTH_CALLBACK_ERROR
andCALLBACK_OAUTH_ERROR
, of which only the latter is documented as errors: https://next-auth.js.org/errors.In #5027 (comment), @ThangHuuVu has suggested that we should:
CALLBACK_ERROR
, andAs a result we can merit from getting rid of subtly discrepant errors, both from docs page and from the source.
In the PR mentioned above, I had attempted to use only
CALLBACK_OAUTH_ERROR
, but after that I found there is theOAuthCallbackError
class. Consequently I'm thinking to useOAUTH_CALLBACK_ERROR
so that documentation better represents the implementation.Is there any context that might help us understand?
After receiving a comment in #5027 I've researched a bit and found some things that might affect the way we sort our docs.
So currently we have in the errors page a headline that says:
while in fact it seems this
expected 200 OK with body but no body was returned
message never happens in callback phase, but in discovery phase. That is, openid-client emits this message when (and apparently only when)/.well-known/openid-configuration
returns no body. cf. https://github.com/panva/node-openid-client/blob/v5.1.8/lib/helpers/process_response.js#L59In next-auth's side, things described below in order happens
SIGNIN_OAUTH_ERROR
withexpected 200 OK with body but no body was returned
So I believe the original content which attributes this error message to
OAUTH_CALLBACK_ERROR
was not true. I guess associating it withSIGNIN_OAUTH_ERROR
can be of help and so I'm planning to create a PR.Does the docs page already exist? Please link to it.
https://next-auth.js.org/errors
The text was updated successfully, but these errors were encountered: