asp.net membership - Sitecore Forced password change -


i need implement such feature . need work x days after last changed password, when login message says, password has expired, please enter new password , confirm new password

do have ideas/suggestions how in proper way?

you can add own processor first processor of loggingin pipeline process method:

public void process(logginginargs args) {     membershipuser user = membership.getuser(args.username);     if (user != null)     {         datetime date = user.lastpasswordchangeddate;         if ((datetime.now - date).totaldays > maxdayswithoutpasswordchange)         {             httpcontext.current.response.redirect("/passwordchangepage");         }     } } 

this redirect users require password change /passwordchangepage url. on page create form old password , new password.

on submitting form execute password change:

membershipuser user = membership.getuser(username); user.changepassword(oldpassword, newpassword); 

Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -