Exemple #1
0
        private bool ValidatePasswordIsCorrect(UpdatePasswordForm model, string password)
        {
            var isValid = _passwords.Validate(_httpContext.User.Identity.Name, password);

            if (!isValid)
            {
                _session.FailedPasswordAttempt();
                var isLockedOut = !ValidateIsNotLockedOut(model, password);
                if (isLockedOut)
                {
                    return(true);
                }
            }
            return(isValid);
        }
Exemple #2
0
        private bool ValidatePasswordIsCorrect(SignInForm model, string password)
        {
            var isValid = _passwords.Validate(model.EmailAddress, password);

            if (!isValid)
            {
                _session.FailedPasswordAttempt();
                var isLockedOut = !ValidateIsNotLockedOut(model, password);
                if (isLockedOut)
                {
                    return(true);
                }
            }
            return(isValid);
        }