diff --git a/lib/WP_Auth0_Import_Settings.php b/lib/WP_Auth0_Import_Settings.php index 29f84dc5..1f58f9da 100644 --- a/lib/WP_Auth0_Import_Settings.php +++ b/lib/WP_Auth0_Import_Settings.php @@ -18,15 +18,10 @@ public function init() { } public function show_error() { -?> -
- - - -
-%s
', + sanitize_text_field( $_REQUEST['error'] ) + ); } public function render_import_settings_page() { diff --git a/lib/admin/WP_Auth0_Admin.php b/lib/admin/WP_Auth0_Admin.php index 52619f43..29d3b9f2 100755 --- a/lib/admin/WP_Auth0_Admin.php +++ b/lib/admin/WP_Auth0_Admin.php @@ -70,16 +70,10 @@ public function admin_enqueue() { return; } - $client_id = $this->a0_options->get( 'client_id' ); - $secret = $this->a0_options->get( 'client_secret' ); - $domain = $this->a0_options->get( 'domain' ); - - if ( empty( $client_id ) || empty( $secret ) || empty( $domain ) ) { + if ( ! WP_Auth0::ready() ) { add_action( 'admin_notices', array( $this, 'create_account_message' ) ); } - $this->validate_required_api_scopes(); - wp_enqueue_media(); wp_enqueue_script( 'wpa0_admin', WPA0_PLUGIN_URL . 'assets/js/admin.js' ); wp_enqueue_script( 'wpa0_async', WPA0_PLUGIN_URL . 'assets/lib/async.min.js' ); @@ -94,25 +88,9 @@ public function admin_enqueue() { ) ); } - protected function validate_required_api_scopes() { - $app_token = $this->a0_options->get( 'auth0_app_token' ); - if ( ! $app_token ) { - add_action( 'admin_notices', array( $this, 'cant_connect_to_auth0' ) ); - } - } - + // TODO: Deprecate, not used public function cant_connect_to_auth0() { -?> - - - - %s%s%s + + %s.', + __( 'Login by Auth0 is not yet configured. Please use the ', 'wp-auth0' ), + admin_url( 'admin.php?page=wpa0-setup' ), + __( 'Setup Wizard', 'wp-auth0' ), + __( ' or follow the ', 'wp-auth0' ), + __( 'Manual setup instructions', 'wp-auth0' ) + ); } protected function get_social_connection( $provider, $name, $icon ) { diff --git a/lib/initial-setup/WP_Auth0_InitialSetup.php b/lib/initial-setup/WP_Auth0_InitialSetup.php index e59ae2e0..70af2639 100644 --- a/lib/initial-setup/WP_Auth0_InitialSetup.php +++ b/lib/initial-setup/WP_Auth0_InitialSetup.php @@ -37,15 +37,6 @@ public function init() { add_action( 'admin_notices', array( $this, 'notify_error' ) ); } } - if ( ! isset( $_REQUEST['page'] ) || 'wpa0-setup' !== $_REQUEST['page'] ) { - $client_id = $this->a0_options->get( 'client_id' ); - $client_secret = $this->a0_options->get( 'client_secret' ); - $domain = $this->a0_options->get( 'domain' ); - - if ( ( ! $client_id ) || ( ! $client_secret ) || ( ! $domain ) ) { - add_action( 'admin_notices', array( $this, 'notify_setup' ) ); - } - } if ( isset( $_REQUEST['error'] ) && 'cant_create_client' == $_REQUEST['error'] ) { add_action( 'admin_notices', array( $this, 'cant_create_client_message' ) ); @@ -87,20 +78,13 @@ public function admin_enqueue() { wp_enqueue_style( 'media' ); } + // TODO: Deprecate public function notify_setup() { -?> -@@ -210,10 +193,10 @@ public function rejected_message() {