• Resolved rapx21

    (@rapx21)


    Hello,

    When I try to log in, the error message “CODE INVALID: The 2FA code provided is expired or invalid. Please try again.” appears.
    The 2FA has always worked fine, only now it’s giving me this error.

    I’ve already emailed the diagnostic file.

    Best regards,
    Rui Raposo

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support wfmark

    (@wfmark)

    Hello @rapx21, and thanks for reaching out to us and sending the diagnostic report.

    This normally occurs when there’s a time offset on your site or device time. From the diagnostic, that looks good.

    Does the same issue occur with both your 2FA app’s generated code AND your backup recovery code(s)? I just wanted to check whether you’d been able to try both methods.

    You could check whether there are any JavaScript errors in your browser console on that page, then paste me a screenshot of what you’re seeing. However, if you need immediate access back I’m happy to provide you with instructions:

    • Please use FTP/SFTP — or any file manager your web host provides via their administration panel.
    • Look inside the /wp-content/plugins/ directory and rename the wordfence directory to wordfence.bak. This will deactivate Wordfence and allow you to login without the 2FA code.
    • Once you have logged in to your WordPress admin you can name the folder back to wordfence again.
    • Go to your user profile and add 2FA back to your account, making sure to download the backup codes in case of problems in the future.

    If you have any other trouble logging in,  feel free to reach out here.

    Thanks,

    Mark.

    Thread Starter rapx21

    (@rapx21)

    Hello Mark,

    Thanks for your reply.

    You can close the ticket. I found the error, the user was using the generator from another user. Thank you.

    Best regards,
    Rui

    • This reply was modified 1 year ago by rapx21.
    • This reply was modified 1 year ago by rapx21.
    • This reply was modified 1 year ago by rapx21.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Invalid Code error with 2FA when logging in’ is closed to new replies.