fix(api): emit 401 on bad credentials during login (#2130)
This commit is contained in:
@@ -44,10 +44,10 @@ public enum ApiError {
|
|||||||
CANNOT_DELETE_ADMIN(HttpStatus.FORBIDDEN, "Admin user cannot be deleted"),
|
CANNOT_DELETE_ADMIN(HttpStatus.FORBIDDEN, "Admin user cannot be deleted"),
|
||||||
FORBIDDEN(HttpStatus.FORBIDDEN, "%s"),
|
FORBIDDEN(HttpStatus.FORBIDDEN, "%s"),
|
||||||
INTERNAL_SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "%s"),
|
INTERNAL_SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "%s"),
|
||||||
PASSWORD_INCORRECT(HttpStatus.BAD_REQUEST, "Incorrect current password"),
|
PASSWORD_INCORRECT(HttpStatus.UNAUTHORIZED, "Incorrect current password"),
|
||||||
PASSWORD_TOO_SHORT(HttpStatus.BAD_REQUEST, "Password must be at least 6 characters long"),
|
PASSWORD_TOO_SHORT(HttpStatus.BAD_REQUEST, "Password must be at least 6 characters long"),
|
||||||
PASSWORD_SAME_AS_CURRENT(HttpStatus.BAD_REQUEST, "New password cannot be the same as the current password"),
|
PASSWORD_SAME_AS_CURRENT(HttpStatus.BAD_REQUEST, "New password cannot be the same as the current password"),
|
||||||
INVALID_CREDENTIALS(HttpStatus.BAD_REQUEST, "Invalid credentials"),
|
INVALID_CREDENTIALS(HttpStatus.UNAUTHORIZED, "Invalid credentials"),
|
||||||
REMOTE_AUTH_DISABLED(HttpStatus.NON_AUTHORITATIVE_INFORMATION, "Remote login is disabled"),
|
REMOTE_AUTH_DISABLED(HttpStatus.NON_AUTHORITATIVE_INFORMATION, "Remote login is disabled"),
|
||||||
SELF_DELETION_NOT_ALLOWED(HttpStatus.FORBIDDEN, "You cannot delete your own account"),
|
SELF_DELETION_NOT_ALLOWED(HttpStatus.FORBIDDEN, "You cannot delete your own account"),
|
||||||
INVALID_INPUT(HttpStatus.BAD_REQUEST, "%s"),
|
INVALID_INPUT(HttpStatus.BAD_REQUEST, "%s"),
|
||||||
|
|||||||
Reference in New Issue
Block a user