From 2ba3c50ffcf8cffbef6b6140aabb0cb22a324e9f Mon Sep 17 00:00:00 2001 From: Josh Cunningham Date: Wed, 31 Jan 2018 09:27:49 -0800 Subject: [PATCH] Removed client grant success message in log for initial setup --- lib/WP_Auth0_Api_Client.php | 5 ----- lib/WP_Auth0_DBManager.php | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/WP_Auth0_Api_Client.php b/lib/WP_Auth0_Api_Client.php index 5ac062ec..7680a432 100755 --- a/lib/WP_Auth0_Api_Client.php +++ b/lib/WP_Auth0_Api_Client.php @@ -666,11 +666,6 @@ public static function create_client_grant( $app_token, $client_id ) { return false; } - WP_Auth0_ErrorManager::insert_auth0_error( - __METHOD__, - 'Client Grant has been successfully created!' - ); - return json_decode( $response['body'] ); } diff --git a/lib/WP_Auth0_DBManager.php b/lib/WP_Auth0_DBManager.php index 4b78d6e4..81359517 100644 --- a/lib/WP_Auth0_DBManager.php +++ b/lib/WP_Auth0_DBManager.php @@ -221,6 +221,14 @@ public function install_db( $version_to_install = null, $app_token = '' ) { if ( $client_grant_created ) { delete_option( 'wp_auth0_client_grant_failed' ); update_option( 'wp_auth0_client_grant_success', 1 ); + + if ( 409 !== $client_grant_created[ 'statusCode' ] ) { + WP_Auth0_ErrorManager::insert_auth0_error( + __METHOD__, + 'Client Grant has been successfully created!' + ); + } + } else { WP_Auth0_ErrorManager::insert_auth0_error( __METHOD__, sprintf( __( 'Unable to automatically create Client Grant. Please go to your Auth0 Dashboard '