BB2-3489: Remove [Object object] errors #1290
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JIRA Ticket:
BB2-3489
What Does This PR Do?
This PR removes the [Object object] errors when invalid scopes are defined in testing. This issue is funny because DOT tries to return an Oauth-style redirect like
This could be OK, but the usage context of our API makes it unlikely that this kind of response is ever useful. The error is most likely to occur in test and the most likely people to see it are not the end users of our API, but our own developers and application developers testing in Postman. For this reason, an Oauth-style redirect error that passes the error back to the callback url is less than ideal. This PR changes the error to a JSON error like
This error is more concise and useful in postman and curl, the only contexts anyone is likely to encounter the error.
What Should Reviewers Watch For?
There were unit tests before I moved the code to this more general place. Manual validation can be simply performed and is described below.
Validation
Run the application locally and use postman to attempt to retrieve a new token, but misspell any of the scopes. You should receive a json error in the authentication popup. You can, alternatively, use cURL.
What Security Implications Does This PR Have?
Please indicate if this PR does any of the following:
security engineer's approval.
Any Migrations?
etc)