public ActionResult RegisterLinkedIn(RegisterLinkedInModel model) { if (ModelState.IsValid) { // Attempt to register the user var createStatus = this.userProcessor.CreateUser(model.UserName, string.Empty, model.Email, model.LinkedInId, model.ImageData, model.ImageMimeType); if (createStatus) { FormsAuthentication.SetAuthCookie(model.UserName,true); return this.RedirectToAction("Index", "Landing"); } else { ModelState.AddModelError(string.Empty, false.ToString(CultureInfo.InvariantCulture)); } } // If we got this far, something failed, redisplay form return this.View(model); }
/// <summary> /// The register linked in. /// </summary> /// <returns> /// The System.Web.Mvc.ActionResult. /// </returns> public ActionResult RegisterLinkedIn() { LinkedInProfile profile = this.linkedInService.GetUserProfile(); var model = new RegisterLinkedInModel { FirstName = profile.Firstname, LastName = profile.Lastname, UserName = profile.Firstname + " " + profile.Lastname, LinkedInId = profile.UserId }; return View(model); }