Skip to content

Commit 406edd7

Browse files
committed
Reset login attempts count
Remove login attempts count when user sets a secret key (see issue #2)
1 parent 0b17f35 commit 406edd7

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

admin/admin.class.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,15 @@ public function SaveCustomProfileFields( $user_id ) {
952952

953953
update_user_meta( $user_id, 'wpga_secret', $_POST['wpga_secret'] );
954954

955+
/**
956+
* Delete the user login attempts without using 2FA.
957+
* This avoids an incorrect number of allowed attempts
958+
* in case the user deactivates the 2FA for his account.
959+
*
960+
* @since 1.0.8
961+
*/
962+
delete_user_meta( $user_id, 'wpga_attempts' );
963+
955964
/* Check if backup key exist */
956965
$backup = get_user_meta( $user_id, 'wpga_backup_key', true );
957966

0 commit comments

Comments
 (0)