WC_Auth::handle_auth_requests │ public │ WC 2.4.0

Handle auth requests.

Method of the class: WC_Auth{}

No Hooks.

Returns

null. Nothing (null).

Usage

$WC_Auth = new WC_Auth();
$WC_Auth->handle_auth_requests();

Changelog

Since 2.4.0 Introduced.

WC_Auth::handle_auth_requests() code WC 11.2.1

public function handle_auth_requests() {
	global $wp;

	if ( ! empty( $_GET['wc-auth-version'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Values are required for handshake validation; key creation verifies capability and nonce.
		$wp->query_vars['wc-auth-version'] = wc_clean( wp_unslash( $_GET['wc-auth-version'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Values are required for handshake validation; key creation verifies capability and nonce.
	}

	if ( ! empty( $_GET['wc-auth-route'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Values are required for handshake validation; key creation verifies capability and nonce.
		$wp->query_vars['wc-auth-route'] = wc_clean( wp_unslash( $_GET['wc-auth-route'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Values are required for handshake validation; key creation verifies capability and nonce.
	}

	// wc-auth endpoint requests.
	if ( ! empty( $wp->query_vars['wc-auth-version'] ) && ! empty( $wp->query_vars['wc-auth-route'] ) ) {
		$this->auth_endpoint( $wp->query_vars['wc-auth-route'] );
	}
}