Yoast\WP\SEO\AI_Authorization\Infrastructure

Access_Token_User_Meta_Repository::get_tokenpublicYoast 1.0

Get the token for a user.

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

Хуков нет.

Возвращает

Строку. The token data.

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

$Access_Token_User_Meta_Repository = new Access_Token_User_Meta_Repository();
$Access_Token_User_Meta_Repository->get_token( $user_id ): string;
$user_id(int) (обязательный)
The user ID.

Код Access_Token_User_Meta_Repository::get_token() Yoast 28.3

public function get_token( int $user_id ): string {
	$access_jwt = $this->user_helper->get_meta( $user_id, self::META_KEY, true );
	if ( ! \is_string( $access_jwt ) || $access_jwt === '' ) {
		throw new RuntimeException( 'Unable to retrieve the access token.' );
	}

	return $access_jwt;
}