public async Task UpdateUserPasswordAsync(UserPasswordUpdateModel passwordUpdate) { var userId = passwordUpdate.UserId; var password = PasswordHashing.GeneratePassword(passwordUpdate.Password); await _userRepository.UpdateUserPasswordAsync(userId, password); }
public async Task <User> CreateUserAsync(User user) { var userEntity = _mapper.Map <Models.Entities.User>(user); userEntity.Password = PasswordHashing.GeneratePassword(userEntity.Password); var userModel = await PerformUserCreation(userEntity); return(userModel); }
public async Task <User> CreateCustomerAsync(AuthUser authUser) { var userEntity = _mapper.Map <Models.Entities.User>(authUser); userEntity.Password = PasswordHashing.GeneratePassword(userEntity.Password); userEntity.UserRole = UserRole.Customer; var userModel = await PerformUserCreation(userEntity); return(userModel); }
public async Task <User> AuthenticateUser(AuthUser authUser) { var userEntity = _mapper.Map <Models.Entities.User>(authUser); userEntity.Password = PasswordHashing.GeneratePassword(userEntity.Password); var foundUserEntity = await _userRepository.AuthenticateUserAsync(userEntity); var userModel = _mapper.Map <User>(foundUserEntity); return(userModel); }