InstaTax.Core.DomainObjects.PasswordHistory.IsSameAsPriorPasswords C# (CSharp) Method

IsSameAsPriorPasswords() public method

public IsSameAsPriorPasswords ( String newPassword ) : bool
newPassword String
return bool
        public bool IsSameAsPriorPasswords(String newPassword)
        {
            var lastThreePriorPasswords = GetLastThreePriorPasswords();
            foreach (Password priorPassword in lastThreePriorPasswords)
            {
                if (newPassword.Equals(priorPassword.PasswordString))
                {
                    return true;
                }
            }
            return false;
        }