mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-22 12:48:58 +08:00
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:
parent
eae5e9afd3
commit
89262b0517
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user