-
Notifications
You must be signed in to change notification settings - Fork 493
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
Adding legacy error handling for co/auth endpoint #685
Conversation
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.
Cleaner than I thought it would look 👍 a few questions/comments
@@ -166,7 +166,9 @@ describe('auth0.WebAuth.crossOriginAuthentication', function() { | |||
error_description: 'a huge error string' | |||
}, | |||
code: 'any 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.
This should probably be a machine_name without spaces
@@ -166,7 +166,9 @@ describe('auth0.WebAuth.crossOriginAuthentication', function() { | |||
error_description: 'a huge error string' | |||
}, | |||
code: 'any error', | |||
description: 'a huge error string' | |||
description: 'a huge error string', | |||
error: 'any 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.
This should probably be a machine_name without spaces
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.
doesn't really matter for the tests though..
src/helper/response-handler.js
Outdated
@@ -42,7 +42,10 @@ function wrapCallback(cb, options) { | |||
if (err.err) { | |||
err = err.err; | |||
} | |||
|
|||
if (options.forceLegacyError) { | |||
errObj.error = err.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.
This means that it's possible for errObj.code
!== errObj.error
... is that intended? Maybe this should fall after where err.code
and errObj.description
are set and set them as equal?
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.
makes sense. pushed a change
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.
LGTM 👍
No description provided.