Skip to content
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

provide helpful message if access token triggers 401: Unauthorized #6283

Merged
merged 2 commits into from
Mar 6, 2018

Conversation

mollymerp
Copy link
Contributor

fix #5852

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • manually test the debug page

@mollymerp mollymerp requested a review from lucaswoj March 5, 2018 20:46
src/util/ajax.js Outdated
@@ -85,7 +85,11 @@ exports.getJSON = function(requestParameters: RequestParameters, callback: Callb
}
callback(null, data);
} else {
callback(new AJAXError(xhr.statusText, xhr.status, requestParameters.url));
if (xhr.status === 401) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about also testing the URL is on the mapbox.com domain? So long as we promise compatibility with third party vector tile sources we must be careful with logic that assumes we're talking to Mapbox servers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea!

@mollymerp mollymerp merged commit 0bd6d31 into master Mar 6, 2018
@mollymerp mollymerp deleted the invalid-token-message branch March 6, 2018 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Friendly message when malformed accessToken provided
2 participants