Provide some directions in the Basic auth input box so the user knows where to provide the API key and secret.

This commit is contained in:
Justin Shreve 2015-06-18 15:27:17 +00:00
parent d63f7d014f
commit 8da19e4dae
1 changed files with 2 additions and 1 deletions

View File

@ -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;