Changeset 18671 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/oauth/OAuthAccessTokenHolder.java
r18650 r18671 121 121 */ 122 122 public IOAuthToken getAccessToken(String api, OAuthVersion version) { 123 api = URI.create(api).getHost(); 124 if (this.tokenMap.containsKey(api)) { 123 // Sometimes the api might be sent as the host 124 api = Optional.ofNullable(URI.create(api).getHost()).orElse(api); 125 if (this.tokenMap.containsKey(api) && this.tokenMap.get(api).containsKey(version)) { 125 126 Map<OAuthVersion, IOAuthToken> map = this.tokenMap.get(api); 126 127 return map.get(version); … … 236 237 if (this.accessTokenKey != null && this.accessTokenSecret != null) { 237 238 cm.storeOAuthAccessToken(new OAuthToken(accessTokenKey, accessTokenSecret)); 239 } else { 240 cm.storeOAuthAccessToken(null); 238 241 } 239 242 for (Map.Entry<String, Map<OAuthVersion, IOAuthToken>> entry : this.tokenMap.entrySet()) {
Note:
See TracChangeset
for help on using the changeset viewer.