diff --git a/blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetailsServiceImpl.java b/blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetailsServiceImpl.java index 0efbd1ce..f2b840da 100644 --- a/blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetailsServiceImpl.java +++ b/blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetailsServiceImpl.java @@ -117,7 +117,7 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService { throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND); } // 用户存在但密码错误,超过次数则锁定账号 - if (!grantType.equals(TokenUtil.REFRESH_TOKEN_KEY) && !user.getPassword().equals(DigestUtil.hex(password))) { + if (grantType != null && !grantType.equals(TokenUtil.REFRESH_TOKEN_KEY) && !user.getPassword().equals(DigestUtil.hex(password))) { setFailCount(tenantId, username, count); throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND); }