Remove reauth endpoint. It's not going to work the way we want it to. If clients need to log out (like a browser), they can clear the sessions per browser. Also returns JSON error when auth is not returned correctly.

This commit is contained in:
Justin Shreve 2015-06-18 21:15:41 +00:00
parent 8da19e4dae
commit 9e2f0f55d8
1 changed files with 1 additions and 6 deletions

View File

@ -41,10 +41,6 @@ class WC_API_Authentication {
return new WP_User( 0 );
}
if ( '/reauth' === untrailingslashit( WC()->api->server->path ) ) {
$this->exit_with_unauthorized_headers();
}
try {
if ( is_ssl() ) {
$keys = $this->perform_ssl_authentication();
@ -114,8 +110,7 @@ class WC_API_Authentication {
$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;
throw new Exception( __( 'Consumer Secret is invalid', 'woocommerce' ), 401 );
}
/**