Esempio n. 1
0
        public async Task <ChatUserDto> Authenticate(string email, string password)
        {
            var user = await _repo.Authenticate(email);

            if (user != null)
            {
                bool isValid = PasswordStorage.VerifyPassword(password, user.PasswordHash);
                if (isValid)
                {
                    return(_mapper.Map <ChatUserDto>(user));
                }
            }

            return(null);
        }