Skip to content

Commit

Permalink
Refactor initial setup initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
joshcanhelp committed Dec 18, 2019
1 parent 0e8f049 commit 7e9b80b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions WP_Auth0.php
Original file line number Diff line number Diff line change
Expand Up @@ -541,17 +541,17 @@ function wp_auth0_settings_admin_action_error() {
add_action( 'admin_notices', 'wp_auth0_settings_admin_action_error' );

function wp_auth0_initial_setup_init() {
if ( ( ! isset( $_REQUEST['page'] ) ) || ( 'wpa0-setup' !== $_REQUEST['page'] ) || ( ! isset( $_REQUEST['callback'] ) ) ) {
if ( 'wpa0-setup' !== ( $_REQUEST['page'] ?? null ) || ! isset( $_REQUEST['callback'] ) ) {
return false;
}

if ( isset( $_REQUEST['error'] ) && 'rejected' == $_REQUEST['error'] ) {
wp_redirect( admin_url( 'admin.php?page=wpa0-setup&error=rejected' ) );
if ( 'rejected' === ( $_REQUEST['error'] ?? null ) ) {
wp_safe_redirect( admin_url( 'admin.php?page=wpa0-setup&error=rejected' ) );
exit;
}

if ( isset( $_REQUEST['error'] ) && 'access_denied' == $_REQUEST['error'] ) {
wp_redirect( admin_url( 'admin.php?page=wpa0-setup&error=access_denied' ) );
if ( 'access_denied' === ( $_REQUEST['error'] ?? null ) ) {
wp_safe_redirect( admin_url( 'admin.php?page=wpa0-setup&error=access_denied' ) );
exit;
}

Expand Down

0 comments on commit 7e9b80b

Please sign in to comment.