public string CreateUser([FromForm] User user) { string enteredPass = user.Password; if (!_invitationDAO.CheckCode(user.Email, user.InvitationCode)) { return("Invitation Code Does not Match"); } if (user != null) { if (user.HomePhone == null) { user.HomePhone = ""; } if (user.CellPhone == null) { user.CellPhone = ""; } user.Salt = PasswordHasher.Salter(); user.Password = PasswordHasher.Hasher(user.Password, user.Salt); user = _userDAO.CreateUser(user); if (user == null) { return("User already exists"); } if (!_invitationDAO.DeleteInvite(user.Email)) { return("Failed to Delete user invitation"); } FilesHelper.CreateUserDirectory(user.Username); var option = new CookieOptions(); option.Expires = DateTime.Now.AddMinutes(10); option.IsEssential = true; Response.Cookies.Delete("userName"); Response.Cookies.Append("userName", user.Username, option); return("User created successfully"); } return("Form not filled out properly"); }