// 2 public async Task <UserDTO> LoginUser(string email, string password) { string passwordHash = CryptoExtension.ToMD5(password); var user = await _userRepository.GetUserByEmail(email); if (user?.Password == passwordHash && user?.Email == email && user.IsConfirmed) { return(_mapper.Map <UserDTO>(user)); } return(null); }
public async Task <UserDTO> AddNewUser(UserDTO userDTO, string header) { var user = _mapper.Map <User>(userDTO); user.IdentityToken = CryptoExtension.ToMD5(RandomToken.RandomString(10)); user.Password = CryptoExtension.ToMD5(user.Password); var newUser = await _userRepository.Create(user); if (newUser == null) { return(null); } // EmailExtension.sendEmail(newUser, url); return(_mapper.Map <UserDTO>(newUser)); }
internal EncryptedQueueRefiller(CryptoExtension _enclosing) { this._enclosing = _enclosing; }