Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/SecurityTokenService/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ public async Task<IActionResult> Login([FromBody] Inputs.V1.LoginInput model)

if (!PasswordLoginTwoFactorEnable)
{
if (model.CaptchaCode.IsNullOrEmpty())
{
return new ObjectResult(new ApiResult
{
Code = Errors.IdentityInvalidCredentials, Success = false, Message = "请输入验证码"
});
}
var checkCaptchaResult = Util.CheckCaptcha(memoryCache, logger, Request, model.CaptchaCode);
if (checkCaptchaResult != null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/SecurityTokenService/Controllers/Inputs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public class LoginInput
/// <summary>
///
/// </summary>
[StringLength(10, ErrorMessage = "验证码长度超长"), Required(ErrorMessage = "请输入验证码")]
[StringLength(10, ErrorMessage = "验证码长度超长")]
public string CaptchaCode { get; set; }

/// <summary>
Expand Down
Loading