예제 #1
0
        public CheckPasswordResult CheckUserPassword(string userName, string password)
        {
            var user = _accountRepository.GetByName(userName);

            if (user is null)
            {
                return(CheckPasswordResult.UserNotFound);
            }

            if (user.Password != _securityProvider.GetPasswordHash(password))
            {
                return(CheckPasswordResult.Fail);
            }

            return(CheckPasswordResult.Success);
        }