Skip to content

Commit

Permalink
fix(Two_Factor_Totp): setting user_id type to integer instead of number
Browse files Browse the repository at this point in the history
current_user_can() expects user_id to be integer

Fixes WordPress#559
Fixes WordPress#557
  • Loading branch information
spenserhale committed Apr 28, 2023
1 parent bb96a02 commit 541e4e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions providers/class-two-factor-totp.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function register_rest_routes() {
'args' => array(
'user_id' => array(
'required' => true,
'type' => 'number',
'type' => 'integer',
),
),
),
Expand All @@ -83,7 +83,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 @@ -223,7 +223,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 541e4e0

Please sign in to comment.