Example #1
0
        public async Task <VerifyUserResult> VerifyUser(string email, string password)
        {
            var userFromDb = await _userRepository.GetUserByEmail(email);

            if (userFromDb == null)
            {
                return(new VerifyUserResult(false, null));
            }

            var isPasswordCorrect = _cryptographyService.CheckPassword(password, userFromDb.Password);

            return(new VerifyUserResult(isPasswordCorrect, userFromDb));
        }