Esempio n. 1
0
        public UserCreateResponse CreateNewUser(CreateNewUserInputModel newUser)
        {
            if (_userRepo.CheckUserExists(newUser.UserName))
            {
                throw new CreateUserException("User name is already taken");
            }

            byte[] passwordHash, passwordSalt;
            _passwordLogic.CreatePasswordHash(newUser.Password, out passwordHash, out passwordSalt);

            ApplicationUser actualNewUser = _mapper.Map <ApplicationUser>(newUser);

            actualNewUser.RegisterDate = DateTime.Now;
            actualNewUser.Uuid         = Guid.NewGuid().ToString();
            actualNewUser.Password     = passwordHash;
            actualNewUser.PasswordSalt = passwordSalt;

            _userRepo.CreateNewUser(actualNewUser);
            //TODO return user token;

            return(null);
        }
 public IActionResult CreateNewUser(CreateNewUserInputModel newUser)
 {
     return(Ok());
 }