コード例 #1
0
        public async Task UpdateUserPasswordAsync(UserPasswordUpdateModel passwordUpdate)
        {
            var userId   = passwordUpdate.UserId;
            var password = PasswordHashing.GeneratePassword(passwordUpdate.Password);

            await _userRepository.UpdateUserPasswordAsync(userId, password);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }