🐛 Fixing a bug. closed #I5BO47 删除令牌报5XX错误

This commit is contained in:
lbw 2022-06-18 22:31:35 +08:00
parent 72337a7a13
commit dac823f400

View File

@ -166,6 +166,10 @@ public class PigTokenEndpoint {
@DeleteMapping("/{token}")
public R<Boolean> removeToken(@PathVariable("token") String token) {
OAuth2Authorization authorization = authorizationService.findByToken(token, OAuth2TokenType.ACCESS_TOKEN);
if (authorization == null) {
return R.ok();
}
OAuth2Authorization.Token<OAuth2AccessToken> accessToken = authorization.getAccessToken();
if (accessToken == null || StrUtil.isBlank(accessToken.getToken().getTokenValue())) {
return R.ok();