revert: 回退apikeyfilter的代码

This commit is contained in:
CaptainB 2023-06-20 10:26:19 +08:00
parent abe075ec27
commit e21ea99dab
1 changed files with 3 additions and 6 deletions

View File

@ -20,13 +20,10 @@ public class ApiKeyFilter extends AnonymousFilter {
// 不是apikey的通过
if (!ApiKeyHandler.isApiKeyCall(httpRequest) && !SecurityUtils.getSubject().isAuthenticated()) {
// sso 带了token的
String token = httpRequest.getHeader(SessionConstants.SSO_TOKEN);
if (StringUtils.isNotBlank(token)) {
String userId = SSOSessionHandler.validate(httpRequest);
if (StringUtils.isNotBlank(userId)) {
SecurityUtils.getSubject().login(new UsernamePasswordToken(userId, SSOSessionHandler.random));
}
}
return true;
}