Copied to clipboard

Flag this post as spam?

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


  • Iaroslav 6 posts 76 karma points
    Dec 26, 2017 @ 09:02
    Iaroslav
    0

    User's AccessFailedCount field is not reset after successful login

    Hi, I've not found such issue in the forum but if it exists, please send me a link and I will close this topic.

    I fount that User AccessFailedCount field is not reset after login. I can see that it stays the same in DB.

    Steps to reproduce: 1. Try to login with a user using wrong password 2 times of 3 in any browser. 2. Login with the same user successfully using right password. 3. Logout. 4. Try to login with the same user using wrong password 2 times. 5. Try to login using right password and you can't do it cause the failed count field wasn't reset previously.

    I found a fix for it. The AccessFailedCount field was updated in DB but not in the BackOfficeIdentityUser reference. So I created custom back office manager and overridden CheckPasswordAsync.

     public override async Task<bool> CheckPasswordAsync(BackOfficeIdentityUser user, string password)
        {
            bool isPasswordValid = await base.CheckPasswordAsync(user, password);
            if (isPasswordValid)
            {
                user.AccessFailedCount = 0;
            }
    
            return isPasswordValid;
        }
    

    Now it works properly.

    Could you please answer if it's my bad or it's an issue?

    Thank you very much.

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 9x admin c-trib
    Dec 27, 2017 @ 11:11
    Alex Skrypnyk
    0

    Hi Iaroslav

    Really good finding, #h5yr!

    Can you make a pull request?

    Thanks,

    Oleksandr

  • Iaroslav 6 posts 76 karma points
    Dec 27, 2017 @ 11:20
    Iaroslav
    0

    Ok, I will try. It's a fix for my project but I'm not sure where I need to put this code in the project. But anyway reviewers will correct me :)

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 9x admin c-trib
    Dec 27, 2017 @ 11:22
    Alex Skrypnyk
    0

    What version of Umbraco are you using?

  • Iaroslav 6 posts 76 karma points
    Dec 27, 2017 @ 11:46
    Iaroslav
    0

    7.5.11

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 9x admin c-trib
    Dec 27, 2017 @ 11:50
    Alex Skrypnyk
    100

    Iaroslav, there is no such problem in Umbraco 7.7.7

  • Iaroslav 6 posts 76 karma points
    Dec 27, 2017 @ 11:51
    Iaroslav
    0

    Ok, great, thank you very much!

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 9x admin c-trib
    Dec 27, 2017 @ 11:52
    Alex Skrypnyk
    0

    You are welcome, have a great day

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies