Skip to content

Commit

Permalink
Use the integer REST API type instead of number, to resolve overly st…
Browse files Browse the repository at this point in the history
…rict user_id capability checks (#560)

* Fixing bug where Super Admins cannot setup Time Based One-Time Password as first Two Factor option on WP VIP
* refactor(Two_Factor_Backup_Codes): setting user_id type to integer instead of number to make consistent with Two_Factor_Totp

Fixes #559
Fixes #557
  • Loading branch information
spenserhale authored and dd32 committed May 22, 2023
1 parent d971a9d commit 441690f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion providers/class-two-factor-backup-codes.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function register_rest_routes() {
'args' => array(
'user_id' => array(
'required' => true,
'type' => 'number',
'type' => 'integer',
),
'enable_provider' => array(
'required' => false,
Expand Down
6 changes: 3 additions & 3 deletions providers/class-two-factor-totp.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function register_rest_routes() {
'args' => array(
'user_id' => array(
'required' => true,
'type' => 'number',
'type' => 'integer',
),
),
),
Expand All @@ -96,7 +96,7 @@ public function register_rest_routes() {
'args' => array(
'user_id' => array(
'required' => true,
'type' => 'number',
'type' => 'integer',
),
'key' => array(
'type' => 'string',
Expand Down Expand Up @@ -227,7 +227,7 @@ public static function generate_qr_code_url( $user, $secret_key ) {

/**
* Filter the Label for the TOTP.
*
*
* Must follow the TOTP format for a "label". Do not URL Encode.
*
* @see https://github.com/google/google-authenticator/wiki/Key-Uri-Format#label
Expand Down

0 comments on commit 441690f

Please sign in to comment.