WC_Auth::handle_auth_requests()publicWC 2.4.0

Handle auth requests.

Method of the class: WC_Auth{}

No Hooks.

Return

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 8.7.0

public function handle_auth_requests() {
	global $wp;

	if ( ! empty( $_GET['wc-auth-version'] ) ) { // WPCS: input var ok, CSRF ok.
		$wp->query_vars['wc-auth-version'] = wc_clean( wp_unslash( $_GET['wc-auth-version'] ) ); // WPCS: input var ok, CSRF ok.
	}

	if ( ! empty( $_GET['wc-auth-route'] ) ) { // WPCS: input var ok, CSRF ok.
		$wp->query_vars['wc-auth-route'] = wc_clean( wp_unslash( $_GET['wc-auth-route'] ) ); // WPCS: input var ok, CSRF ok.
	}

	// 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'] );
	}
}