mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-12 05:39:00 +08:00
🍻 close #3705 用户被锁定时,后台提示用户帐号已被锁定,请求返回用户名不存在或者密码错误
This commit is contained in:
1 parent
f003209b26
commit
33f713d17d
1 file changed
+1
-6
+1
-6
@@ -18,7 +18,6 @@
|
||||
package com.pig4cloud.pigx.common.security.component;
|
||||
|
||||
import com.pig4cloud.pigx.common.security.exception.*;
|
||||
import com.pig4cloud.pigx.common.security.util.PigxSecurityMessageSourceUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -33,8 +32,6 @@ import org.springframework.security.oauth2.provider.error.WebResponseExceptionTr
|
||||
import org.springframework.security.web.util.ThrowableAnalyzer;
|
||||
import org.springframework.web.HttpRequestMethodNotSupportedException;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020-06-20 OAutH Server 异常处理,重写oauth 默认实现
|
||||
@@ -65,9 +62,7 @@ public class PigxWebResponseExceptionTranslator implements WebResponseExceptionT
|
||||
ase = (InvalidGrantException) throwableAnalyzer.getFirstThrowableOfType(InvalidGrantException.class,
|
||||
causeChain);
|
||||
if (ase != null) {
|
||||
String msg = PigxSecurityMessageSourceUtil.getAccessor().getMessage(
|
||||
"AbstractUserDetailsAuthenticationProvider.badCredentials", ase.getMessage(), Locale.CHINA);
|
||||
return handleOAuth2Exception(new InvalidException(msg, ase));
|
||||
return handleOAuth2Exception(new InvalidException(ase.getLocalizedMessage(), ase));
|
||||
}
|
||||
|
||||
ase = (HttpRequestMethodNotSupportedException) throwableAnalyzer
|
||||
|
||||
Reference in new issue
Block a user