|
|
|
@ -87,17 +87,17 @@ public class YamiTokenServices implements AuthorizationServerTokenServices, Reso
|
|
|
|
OAuth2AccessToken existingAccessToken = tokenStore.getAccessToken(authentication);
|
|
|
|
OAuth2AccessToken existingAccessToken = tokenStore.getAccessToken(authentication);
|
|
|
|
OAuth2RefreshToken refreshToken = null;
|
|
|
|
OAuth2RefreshToken refreshToken = null;
|
|
|
|
// 如果有token,直接删除,更新token,避免出现缓存问题
|
|
|
|
// 如果有token,直接删除,更新token,避免出现缓存问题
|
|
|
|
if (existingAccessToken != null) {
|
|
|
|
// if (existingAccessToken != null) {
|
|
|
|
if (existingAccessToken.getRefreshToken() != null) {
|
|
|
|
// if (existingAccessToken.getRefreshToken() != null) {
|
|
|
|
refreshToken = existingAccessToken.getRefreshToken();
|
|
|
|
// refreshToken = existingAccessToken.getRefreshToken();
|
|
|
|
// The token store could remove the refresh token when the
|
|
|
|
// // The token store could remove the refresh token when the
|
|
|
|
// access token is removed, but we want to
|
|
|
|
// // access token is removed, but we want to
|
|
|
|
// be sure...
|
|
|
|
// // be sure...
|
|
|
|
tokenStore.removeRefreshToken(refreshToken);
|
|
|
|
// tokenStore.removeRefreshToken(refreshToken);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
tokenStore.removeAccessToken(existingAccessToken);
|
|
|
|
// tokenStore.removeAccessToken(existingAccessToken);
|
|
|
|
|
|
|
|
//
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// Only create a new refresh token if there wasn't an existing one
|
|
|
|
// Only create a new refresh token if there wasn't an existing one
|
|
|
|
// associated with an expired access token.
|
|
|
|
// associated with an expired access token.
|
|
|
|
|