diff --git a/wizard/class-instant-articles-wizard.php b/wizard/class-instant-articles-wizard.php index d0fa4dc1..050072c3 100644 --- a/wizard/class-instant-articles-wizard.php +++ b/wizard/class-instant-articles-wizard.php @@ -263,6 +263,18 @@ public static function render( $ajax = false ) { } // ---------------------------------- + // Handle redirection from Login flow + // ---------------------------------- + // Only during STATE_PAGE_SELECTION + if ( $current_state === Instant_Articles_Wizard_State::STATE_PAGE_SELECTION ) { + $fb_helper = new Instant_Articles_Wizard_FB_Helper(); + try { + $pages = $fb_helper->get_pages(); + } catch ( Facebook\Exceptions\FacebookSDKException $e ) { + // If we couldn't fetch the pages, revert to the App setup + Instant_Articles_Wizard_State::do_transition( Instant_Articles_Wizard_State::STATE_APP_SETUP ); + } + } // Grabs the current configured style // ---------------------------------- diff --git a/wizard/templates/page-selection-template.php b/wizard/templates/page-selection-template.php index aa8b6560..148bd4d9 100644 --- a/wizard/templates/page-selection-template.php +++ b/wizard/templates/page-selection-template.php @@ -32,7 +32,7 @@ Create one.