Skip to content

Commit

Permalink
Backup Codes: Always generate 10 codes via REST.
Browse files Browse the repository at this point in the history
The internal function accepts a param for flexibility, but currently there's no use case for letting the user choose how many they want.
  • Loading branch information
iandunn committed Feb 9, 2023
1 parent 0d61135 commit 99ec9be
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion class-two-factor-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ public static function filter_authenticate_block_cookies( $user ) {

return $user;
}

/**
* If the current user can login via API requests such as XML-RPC and REST.
*
Expand Down
5 changes: 0 additions & 5 deletions providers/class-two-factor-backup-codes.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ public function register_rest_routes() {
'required' => true,
'type' => 'number',
),
'number' => array(
'type' => 'number',
'default' => self::NUMBER_OF_CODES,
),
'append' => array(
'type' => 'boolean',
'default' => false,
Expand Down Expand Up @@ -270,7 +266,6 @@ public function rest_generate_codes( $request ) {
$user = get_user_by( 'id', $user_id );

$args = array(
'number' => $request['number'],
'method' => wp_validate_boolean( $request['append'] ) ? 'append' : 'replace',
);

Expand Down

0 comments on commit 99ec9be

Please sign in to comment.