Skip to content

Commit

Permalink
Merge pull request #155 from WP-API/handle-oob-correctly
Browse files Browse the repository at this point in the history
Properly show verification UI during out-of-band flow
  • Loading branch information
rmccue authored Aug 18, 2016
2 parents 3872b95 + 0724bef commit fcabdbb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/class-wp-rest-oauth1-ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,7 @@ public function page_fields() {
* @return null|WP_Error Null on success, error otherwise
*/
public function handle_callback_redirect( $verifier ) {
if ( ! empty( $this->token['callback'] ) && $this->token['callback'] === 'oob' ) {
return apply_filters( 'json_oauth1_handle_callback', null, $this->token );
}

if ( empty( $this->token['callback'] ) ) {
if ( empty( $this->token['callback'] ) || $this->token['callback'] === 'oob' ) {
// No callback registered, display verification code to the user
login_header( __( 'Access Token', 'rest_oauth1' ) );
echo '<p>' . sprintf( __( 'Your verification token is <code>%s</code>', 'rest_oauth1' ), $verifier ) . '</p>';
Expand Down

0 comments on commit fcabdbb

Please sign in to comment.