public static ObjectResult GetSigninLockedResponse(this SigninLockStatusResultModel model) { var response = new { message = model.Message, retryPeriodInMinutes = model.RetryPeriodInMinutesWhenLocked }; return(new ObjectResult(response) { StatusCode = (int)HttpStatusCode.TooManyRequests }); }
public async Task <SigninLockStatusResultModel> IsSigninLockedAsync(string email) { if (string.IsNullOrEmpty(email)) { throw new ArgumentNullException(nameof(email)); } var(customerIdentity, sanitizedIdentity) = await GetCustomerIdentityAsync(email); var isLocked = await _locksService.DoesLockExistAsync(customerIdentity); return(isLocked ? SigninLockStatusResultModel.Locked((int)_config.AccountLockPeriod.TotalMinutes) : SigninLockStatusResultModel.NotLocked()); }