Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Fix expiring token blocking users on page selection state #458

Merged
merged 1 commit into from
Sep 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions wizard/class-instant-articles-wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
// ----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion wizard/templates/page-selection-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<strong><a href="https://www.facebook.com/pages/create" target="_blank">Create one</a>.</strong>
</p>
<ul class="instant-articles-wizard-page-selection">
<?php foreach ( $fb_helper->get_pages() as $page ) { ?>
<?php foreach ( $pages as $page ) { ?>
<li>
<input
type="radio"
Expand Down