Carrotware.CMS.Core.SecurityData.ResetPassword C# (CSharp) Метод

ResetPassword() публичный Метод

public ResetPassword ( ApplicationUser user, string code, string password ) : Microsoft.AspNet.Identity.IdentityResult
user ApplicationUser
code string
password string
Результат Microsoft.AspNet.Identity.IdentityResult
        public IdentityResult ResetPassword(ApplicationUser user, string code, string password)
        {
            IdentityResult result = new IdentityResult();

            if (user != null && !String.IsNullOrEmpty(user.Id)) {
                using (var securityHelper = new SecurityHelper()) {
                    result = securityHelper.UserManager.ResetPassword(user.Id, code, password);

                    return result;
                }
            }

            return result;
        }

Same methods

SecurityData::ResetPassword ( string email ) : bool
SecurityData::ResetPassword ( string resetUri, string email ) : bool

Usage Example

		public async Task<ActionResult> ForgotPassword(ForgotPasswordViewModel model) {
			if (ModelState.IsValid) {
				var user = await securityHelper.UserManager.FindByEmailAsync(model.Email);
				if (user == null) {
					// Don't reveal that the user does not exist or is not confirmed
					return View("ForgotPasswordConfirmation");
				} else {
					SecurityData sd = new SecurityData();
					sd.ResetPassword(model.Email);
					return RedirectToAction("ForgotPasswordConfirmation");
				}
			}

			Helper.HandleErrorDict(ModelState);
			// If we got this far, something failed, redisplay form
			return View(model);
		}
All Usage Examples Of Carrotware.CMS.Core.SecurityData::ResetPassword