public IActionResult Register(RegisterViewModel vm) { User user = new User(); user.Username = vm.Username; user.Password = vm.Password; user.Email = vm.Email; registerLogic.Register(user); return(RedirectToAction("Index", "Home")); }
public async Task <IActionResult> SignUp(SignUpViewModel model) { var user = RegisterLogic.Register(model); if (user.GetUser == null) { TempData.AddOrUpdate("SignUpError", user.GetErrorMessage); } else { await Authenticate(user.GetUser); } return(Redirect(Request.Headers["Referer"].ToString())); }