Exemplo n.º 1
0
        public async Task <ActionResult> Register(RegisterInput input)
        {
            if (!ModelState.IsValid)
            {
                return(View(input));
            }

            var user = new User()
            {
                Email = input.Email, Name = input.Name, Password = input.Password
            };
            //user.HashPassword();

            await _userTaskService.CreateUser(user);

            Auth.Authenticate(user, ControllerContext.HttpContext.Response);

            return(RedirectToAction("Index", "Home"));
        }