Exemplo n.º 1
0
        public User Register(User user)
        {
            if (_userAccess.GetByEmail(user.Email) != null)
            {
                return(null);
            }
            var newUser = new User
            {
                Email        = user.Email,
                Password     = user.Password,
                VerifyString = (DateTime.UtcNow.Date + Guid.NewGuid().ToString()).Replace("-", string.Empty).Replace(" ", string.Empty)
            };
            var createdUser = NewPassword(newUser);
            var returnUser  = _userAccess.Create(createdUser);

            if (returnUser != null)
            {
                //Todo: Fix Email Sent For Verify
                Email.SendEmail(returnUser.Email, "Email Verification - NoReply",
                                "Thank you for registering with us, this email is to verify your email. Please click the following link to verify your account.\n\n "
                                + "http://InsertAddressHere.com" + returnUser.VerifyString);
            }
            return(returnUser);
        }
        public void RegisterUser(UserDTO user)
        {
            UserDTO model = _user.AlterUserCredentialsToHash(user);

            _userAccess.Create(model);
        }