diff --git a/pig-auth/src/main/java/com/pig4cloud/pig/auth/endpoint/PigTokenEndpoint.java b/pig-auth/src/main/java/com/pig4cloud/pig/auth/endpoint/PigTokenEndpoint.java index 7be59074..7be42f7a 100644 --- a/pig-auth/src/main/java/com/pig4cloud/pig/auth/endpoint/PigTokenEndpoint.java +++ b/pig-auth/src/main/java/com/pig4cloud/pig/auth/endpoint/PigTokenEndpoint.java @@ -166,6 +166,10 @@ public class PigTokenEndpoint { @DeleteMapping("/{token}") public R removeToken(@PathVariable("token") String token) { OAuth2Authorization authorization = authorizationService.findByToken(token, OAuth2TokenType.ACCESS_TOKEN); + if (authorization == null) { + return R.ok(); + } + OAuth2Authorization.Token accessToken = authorization.getAccessToken(); if (accessToken == null || StrUtil.isBlank(accessToken.getToken().getTokenValue())) { return R.ok();