|
@@ -275,14 +275,13 @@ public class CustomTokenServices implements AuthorizationServerTokenServices, Re
|
|
return clientAuth.getClientId();
|
|
return clientAuth.getClientId();
|
|
}
|
|
}
|
|
|
|
|
|
- public boolean revokeToken(String clientId, String phone){
|
|
|
|
|
|
+ public boolean revokeToken(String clientId, String phone) {
|
|
Collection<OAuth2AccessToken> list = tokenStore.findTokensByClientIdAndUserName(clientId, SecurityConstants.PHONE_PRINCIPAL_PREFIX + phone);
|
|
Collection<OAuth2AccessToken> list = tokenStore.findTokensByClientIdAndUserName(clientId, SecurityConstants.PHONE_PRINCIPAL_PREFIX + phone);
|
|
|
|
|
|
if (list == null || list.size() == 0) {
|
|
if (list == null || list.size() == 0) {
|
|
list = tokenStore.findTokensByClientIdAndUserName(clientId, SecurityConstants.USERNAME_PRINCIPAL_PREFIX + phone);
|
|
list = tokenStore.findTokensByClientIdAndUserName(clientId, SecurityConstants.USERNAME_PRINCIPAL_PREFIX + phone);
|
|
- } else {
|
|
|
|
- list.addAll(tokenStore.findTokensByClientIdAndUserName(clientId, SecurityConstants.USERNAME_PRINCIPAL_PREFIX + phone));
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
if (list != null) {
|
|
if (list != null) {
|
|
for (OAuth2AccessToken accessToken : list) {
|
|
for (OAuth2AccessToken accessToken : list) {
|
|
if (accessToken != null) {
|
|
if (accessToken != null) {
|