- Timestamp:
- 2020-01-25T16:11:37+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java
r12992 r15757 132 132 } 133 133 } 134 // see #11914: clear cache before we store new value 135 purgeCredentialsCache(requestorType); 134 136 delegate.store(requestorType, host, credentials); 135 137 } … … 138 140 public CredentialsAgentResponse getCredentials(RequestorType requestorType, String host, boolean noSuccessWithLastResponse) 139 141 throws CredentialsAgentException { 140 return delegate.getCredentials(requestorType, host, noSuccessWithLastResponse); 142 CredentialsAgentResponse credentials = delegate.getCredentials(requestorType, host, noSuccessWithLastResponse); 143 if (requestorType == RequestorType.SERVER) { 144 // see #11914 : Keep UserIdentityManager up to date 145 String userName = credentials.getUsername(); 146 userName = userName == null ? "" : userName.trim(); 147 if (!Objects.equals(UserIdentityManager.getInstance().getUserName(), userName)) { 148 if (userName.isEmpty()) 149 UserIdentityManager.getInstance().setAnonymous(); 150 else 151 UserIdentityManager.getInstance().setPartiallyIdentified(userName); 152 } 153 } 154 return credentials; 141 155 } 142 156
Note:
See TracChangeset
for help on using the changeset viewer.