public ActionResult Login(LoginModel model, string returnUrl) { if (base.ModelState.IsValid) { bool rememberMe = model.RememberMe; if (WebSecurity.Login(model.UserName, model.Password, rememberMe)) { return this.RedirectToLocal(returnUrl); } int userId = WebSecurity.GetUserId(model.UserName); if ((userId > 0) && !WebSecurity.IsConfirmed(model.UserName)) { base.ModelState.AddModelError("", AccountStrings.AccountLogin_EmailNotConfirmed); string userConfirmationToken = MembershipHelper.GetUserConfirmationToken(userId); if (userConfirmationToken != null) { base.ModelState.AddModelError("", AccountStrings.RegisterEmailNotConfirmedNote); this.SendRegistrationConfirmMail(ConfirmMailOperation.confirm, model.UserName, userConfirmationToken); } } else { base.ModelState.AddModelError("", AccountStrings.AccountLogin_InvalidCredentails); } } ((dynamic) base.ViewBag).ReturnUrl = returnUrl; return base.View(model); }
public ActionResult Login(string returnUrl) { LoginModel model = new LoginModel(); ((dynamic) base.ViewBag).ReturnUrl = returnUrl; return base.View(model); }