Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Harrison 42 posts 254 karma points
    Feb 06, 2020 @ 12:36
    Harrison
    0

    Unlock member account and reset failed login attempts after change password

    Hi,

    Trying to figure out how to reset a member's failed password attempts and unlock their account programatically after they've changed their password.

    I sent out an email to them with a reset password link. If it's valid they can enter a new password. I use the IMemberService SavePassword method to change the password, but this doesn't unlock the account. The MembershipHelper ChangePassword requires the current password to be provided.

    I've tried updating the IsLockedOut and FailedPasswordAttempts property on the IMember entity. This worked in Umbraco 7, but doesn't seem to work in Umbraco 8.

    Feel like I'm missing something simple in getting this working?

  • Harrison 42 posts 254 karma points
    Feb 06, 2020 @ 14:31
    Harrison
    101

    Got it working with the only thing I hadn't tried, by setting the properties on IMember via SetValue 🤦‍♂️

    member.SetValue("umbracoMemberLockedOut", false);
    member.SetValue("umbracoMemberFailedPasswordAttempts", 0);
    

    with member being the IMember, did the trick!

Please Sign in or register to post replies

Write your reply to:

Draft