File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ class WP_JSON_Authentication_OAuth1 extends WP_JSON_Authentication {
11
11
const CONSUMER_SECRET_LENGTH = 48 ;
12
12
const TOKEN_KEY_LENGTH = 24 ;
13
13
const TOKEN_SECRET_LENGTH = 48 ;
14
+ const VERIFIER_LENGTH = 24 ;
14
15
15
16
/**
16
17
* Authentication type
@@ -319,7 +320,7 @@ public function generate_request_token( $params ) {
319
320
*
320
321
* Enables the request token to be used to generate an access token
321
322
* @param string $key Token ID
322
- * @return bool |WP_Error True on success, error otherwise
323
+ * @return string |WP_Error Verification code on success, error otherwise
323
324
*/
324
325
public function authorize_request_token ( $ key ) {
325
326
$ token = $ this ->get_request_token ( $ key );
@@ -328,9 +329,10 @@ public function authorize_request_token( $key ) {
328
329
}
329
330
330
331
$ token ['authorized ' ] = true ;
332
+ $ token ['verifier ' ] = wp_generate_password ( self ::VERIFIER_LENGTH , false );
331
333
$ token = apply_filters ( 'oauth_request_token_authorized_data ' , $ token );
332
334
update_option ( 'oauth1_request_ ' . $ key , $ token );
333
- return true ;
335
+ return $ token [ ' verifier ' ] ;
334
336
}
335
337
336
338
/**
You can’t perform that action at this time.
0 commit comments