From 8da19e4daed3c7926c8d0c2be09f584eb6bbb5c4 Mon Sep 17 00:00:00 2001 From: Justin Shreve Date: Thu, 18 Jun 2015 15:27:17 +0000 Subject: [PATCH] Provide some directions in the Basic auth input box so the user knows where to provide the API key and secret. --- includes/api/class-wc-api-authentication.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/api/class-wc-api-authentication.php b/includes/api/class-wc-api-authentication.php index ef857a62360..d4878e8895a 100644 --- a/includes/api/class-wc-api-authentication.php +++ b/includes/api/class-wc-api-authentication.php @@ -111,7 +111,8 @@ class WC_API_Authentication { * @since 2.4 */ private function exit_with_unauthorized_headers() { - header( 'WWW-Authenticate: Basic realm="' . __( 'WooCommerce API', 'woocommerce' ) . '"' ); + $auth_message = __( 'WooCommerce API. Use a consumer key in the username field and a consumer secret in the password field', 'woocommerce' ); + header( 'WWW-Authenticate: Basic realm="' . $auth_message . '"' ); header( 'HTTP/1.0 401 Unauthorized' ); esc_html_e( 'A valid consumer key and secret must be provided to access this resource', 'woocommerce' ); exit;