Skip to content

Commit dffe79d

Browse files
committed
Use the correct variables
This was messed up in a merge previously.
1 parent 6b7cbe0 commit dffe79d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/class-wp-json-authentication-oauth1.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public function authenticate( $user ) {
167167
list( $consumer, $user ) = $result;
168168

169169
// Perform OAuth validation
170-
$error = $this->check_oauth_signature( $user, $params, $token );
170+
$error = $this->check_oauth_signature( $consumer, $params, $token );
171171
if ( is_wp_error( $error ) ) {
172172
$this->auth_status = $error;
173173
return null;
@@ -180,7 +180,7 @@ public function authenticate( $user ) {
180180
}
181181

182182
$this->auth_status = true;
183-
return $user;
183+
return $user->ID;
184184
}
185185

186186
/**
@@ -518,10 +518,11 @@ protected function check_oauth_signature( $consumer, $oauth_params, $token = nul
518518
}
519519
$query_string = implode( '%26', $query_params ); // join with ampersand
520520

521+
$token = (array) $token;
521522
$string_to_sign = $http_method . '&' . $base_request_uri . '&' . $query_string;
522523
$key_parts = array(
523524
$consumer->secret,
524-
( $token ? $token->secret : '' )
525+
( $token ? $token['secret'] : '' )
525526
);
526527
$key = implode( '&', $key_parts );
527528

0 commit comments

Comments
 (0)