Yoast\WP\SEO\MyYoast_Client\User_Interface

Auth_Command::verifypublicYoast 1.0

Verifies the client registration with the server.

Reads the current registration from the authorization server to confirm it is still valid and shows the registration metadata.

OPTIONS

[--format=<format>]
Output format.
--- default: table options:
  • table
  • json

EXAMPLES

wp yoast auth verify
wp yoast auth verify --format=json

Метод класса: Auth_Command{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$Auth_Command = new Auth_Command();
$Auth_Command->verify( $args, $assoc_args ): void;
$args
.
По умолчанию: null
$assoc_args
.
По умолчанию: null

Код Auth_Command::verify() Yoast 27.7

public function verify( $args = null, $assoc_args = null ): void {
	if ( ! $this->myyoast_client->is_registered() ) {
		WP_CLI::error( 'Not registered. Run "wp yoast auth register" first.' );
	}

	try {
		$metadata = $this->myyoast_client->verify_registration();
	} catch ( Exception $e ) {
		WP_CLI::error( 'Verification failed: ' . $e->getMessage() );
		return;
	}

	// Redact sensitive fields.
	unset( $metadata['registration_access_token'] );

	$this->output( $this->flatten_for_display( $metadata ), $assoc_args['format'] );

	WP_CLI::success( 'Registration is valid.' );
}