...
|
...
|
@@ -42,6 +42,7 @@ import org.thingsboard.server.common.data.exception.ThingsboardErrorCode; |
42
|
42
|
import org.thingsboard.server.common.data.exception.ThingsboardException;
|
43
|
43
|
import org.thingsboard.server.common.data.yunteng.core.Result;
|
44
|
44
|
import org.thingsboard.server.common.data.yunteng.core.exception.ThingsKitException;
|
|
45
|
+import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage;
|
45
|
46
|
import org.thingsboard.server.common.msg.tools.TbRateLimitsException;
|
46
|
47
|
import org.thingsboard.server.dao.exception.DataValidationException;
|
47
|
48
|
import org.thingsboard.server.service.security.exception.AuthMethodNotSupportedException;
|
...
|
...
|
@@ -199,7 +200,7 @@ public class ThingsboardErrorResponseHandler extends ResponseEntityExceptionHand |
199
|
200
|
} else if (authenticationException instanceof DisabledException) {
|
200
|
201
|
mapper.writeValue(response.getWriter(), ThingsboardErrorResponse.of("User account is not active", ThingsboardErrorCode.AUTHENTICATION, HttpStatus.UNAUTHORIZED));
|
201
|
202
|
} else if (authenticationException instanceof LockedException) {
|
202
|
|
- mapper.writeValue(response.getWriter(), ThingsboardErrorResponse.of("User account is locked due to security policy", ThingsboardErrorCode.AUTHENTICATION, HttpStatus.UNAUTHORIZED));
|
|
203
|
+ mapper.writeValue(response.getWriter(), ThingsboardErrorResponse.of(ErrorMessage.ACCOUNT_LOCKED.getMessage(), ThingsboardErrorCode.AUTHENTICATION, HttpStatus.UNAUTHORIZED));
|
203
|
204
|
} else if (authenticationException instanceof JwtExpiredTokenException) {
|
204
|
205
|
mapper.writeValue(response.getWriter(), ThingsboardErrorResponse.of("Token has expired", ThingsboardErrorCode.JWT_TOKEN_EXPIRED, HttpStatus.UNAUTHORIZED));
|
205
|
206
|
} else if (authenticationException instanceof AuthMethodNotSupportedException) {
|
...
|
...
|
|