Skip to content

Commit

Permalink
fix: meta key is incorrect for non-default database table prefix [#9]
Browse files Browse the repository at this point in the history
  • Loading branch information
joshcanhelp committed Jan 4, 2022
1 parent 1c45a3c commit 3d7965c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wp-rest-api-auth0.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* @return int|null
*/
function determine_current_user( $user ) {
global $wpdb;

// Only checked, not saved or output anywhere.
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput
Expand Down Expand Up @@ -69,7 +70,7 @@ function determine_current_user( $user ) {
$wp_user = current(
get_users(
array(
'meta_key' => 'wp_auth0_id',
'meta_key' => $wpdb->prefix . 'auth0_id',
'meta_value' => $decoded_token['sub'],
)
)
Expand Down

0 comments on commit 3d7965c

Please sign in to comment.