public ActionResult Edit() { //if (user == null) { var user = new User(); //} return View(user); }
public ActionResult Index(User user) { var auth = new Authorization(); auth.AddUser(user); // Create session FormsAuthentication.SetAuthCookie(user.Email, true); return RedirectToAction("Login", "Account"); }
public void AddUser(User user) { // Validate foreach (var u in data.Users) { if (u.Email == user.Email) { throw new Exception("User already exist"); } } // hash password user.Password = BCrypt.Net.BCrypt.HashPassword(user.Password,9); data.Users.Add(user); Save(); }
public ActionResult Edit(User newUser) { _auth.AddUser(newUser); return View(); }
public UserViewModel(User user) { Username = user.Email; Password = user.Password; }
public ActionResult Index(User user) { var auth = new Authorization(); auth.AddUser(user); return RedirectToAction("Login", "Account"); }