update pig-auth/src/main/java/com/pig4cloud/pig/auth/endpoint/PigTokenEndpoint.java.

调用authenticationFailureHandler应该立即返回才是,怎么会继续下去执行,不能对一个问题响应多次吧

Signed-off-by: LiruoY <2372221537@qq.com>
This commit is contained in:
LiruoY 2022-10-22 10:29:14 +00:00 committed by Gitee
parent eae5e9afd3
commit 89262b0517
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -146,6 +146,7 @@ public class PigTokenEndpoint {
httpResponse.setStatusCode(HttpStatus.UNAUTHORIZED);
this.authenticationFailureHandler.onAuthenticationFailure(request, response,
new InvalidBearerTokenException(OAuth2ErrorCodesExpand.TOKEN_MISSING));
return;
}
OAuth2Authorization authorization = authorizationService.findByToken(token, OAuth2TokenType.ACCESS_TOKEN);
@ -153,6 +154,7 @@ public class PigTokenEndpoint {
if (authorization == null || authorization.getAccessToken() == null) {
this.authenticationFailureHandler.onAuthenticationFailure(request, response,
new InvalidBearerTokenException(OAuth2ErrorCodesExpand.INVALID_BEARER_TOKEN));
return;
}
Map<String, Object> claims = authorization.getAccessToken().getClaims();