Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Correct accesstoken validation #12458

Merged
merged 1 commit into from Jul 23, 2018
Merged

Correct accesstoken validation #12458

merged 1 commit into from Jul 23, 2018

Conversation

tobrun
Copy link
Member

@tobrun tobrun commented Jul 23, 2018

This PR fixes invalid accestoken validation.

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Jul 23, 2018
@tobrun tobrun added this to the android-v6.4.0 milestone Jul 23, 2018
@tobrun tobrun self-assigned this Jul 23, 2018
@tobrun tobrun requested a review from LukasPaczos July 23, 2018 10:16
@tobrun tobrun force-pushed the tvn-accesstoken-validation branch 2 times, most recently from 4d332f3 to f8c51b8 Compare July 23, 2018 10:34
return !(TextUtils.isEmpty(accessToken)
|| (!accessToken.toLowerCase(MapboxConstants.MAPBOX_LOCALE).startsWith("pk.")));
static boolean isAccessTokenValid(String accessToken) {
return !(accessToken == null || accessToken.length() == 0)
Copy link
Member

Choose a reason for hiding this comment

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

We could also trim the string.

Copy link
Member Author

Choose a reason for hiding this comment

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

done in 45b6069

@tobrun tobrun force-pushed the tvn-accesstoken-validation branch from f8c51b8 to 45b6069 Compare July 23, 2018 12:02
@tobrun tobrun merged commit bfe714e into master Jul 23, 2018
@tobrun tobrun deleted the tvn-accesstoken-validation branch July 23, 2018 12:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants