예제 #1
0
        public ActionResult ResetPassword(ResetPassword model)
        {
            if (string.IsNullOrWhiteSpace(model.Email))
            {
                return(View());
            }

            // "If the email provided is associated with an account, you will receive reset instructions there shortly. Thanks!"
            // The block below should be in a background task, to avoid revealing whether a user
            // is a member of the site due to response time (if we check now)

            var hash = _activation.StoreAuthenticationTicketForReset(model.Email);

            _email.Send("ResetPassword", new
            {
                To                = model.Email,
                From              = Cohort.Site.Email.FromAddress,
                Subject           = Cohort.Site.Email.ResetSubject,
                ResetPasswordLink = GetResetPasswordLink(hash),
                Cohort.Site.Membership.PasswordResetDays
            });

            return(View("ResetPassword_EmailSent"));
        }