-
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
Fix inconsistent cross origin error handling #667
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,7 +252,7 @@ describe('auth0.WebAuth.crossOriginAuthentication', function() { | |
response: { | ||
body: { | ||
error: 'any_error', | ||
error_description: 'any error' | ||
error_description: 'a super big error message description' | ||
} | ||
} | ||
}); | ||
|
@@ -267,7 +267,11 @@ describe('auth0.WebAuth.crossOriginAuthentication', function() { | |
anotherOption: 'foobar' | ||
}, | ||
function(err) { | ||
expect(err).to.be.eql({ error: 'any_error', error_description: 'any error' }); | ||
expect(err).to.be.eql({ | ||
original: { error: 'any_error', error_description: 'a super big error message description' }, | ||
code: 'any_error', | ||
description: 'a super big error message description' | ||
}); | ||
expect(_this.webAuthSpy.authorize.called).to.be.eql(false); | ||
done(); | ||
} | ||
|
@@ -300,8 +304,12 @@ describe('auth0.WebAuth.crossOriginAuthentication', function() { | |
}, | ||
function(err) { | ||
expect(err).to.be.eql({ | ||
error: 'request_error', | ||
error_description: '{"some":"error"}' | ||
original: { | ||
error: 'request_error', | ||
error_description: '{"some":"error"}' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are you sure this particular error description is an object? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's a string, not an object. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}, | ||
code: 'request_error', | ||
description: '{"some":"error"}' | ||
}); | ||
expect(_this.webAuthSpy.authorize.called).to.be.eql(false); | ||
done(); | ||
|
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.
what convention are you following by using a lowercase for the first letter and a capital one for the
WebMessageHandler
?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.
WebMessageHandler is a class, responseHandler is a function