Yoast\WP\SEO\MyYoast_Client\Application
MyYoast_Client::revoke_user_token
Revokes the user's tokens and clears storage.
Метод класса: MyYoast_Client{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$MyYoast_Client = new MyYoast_Client(); $MyYoast_Client->revoke_user_token( $user_id ): void;
- $user_id(int) (обязательный)
- The WordPress user ID.
Код MyYoast_Client::revoke_user_token() MyYoast Client::revoke user token Yoast 27.7
public function revoke_user_token( int $user_id ): void {
$token_set = $this->user_token_storage->get( $user_id );
if ( $token_set === null ) {
return;
}
// Assume tokens are opaque for forwards compatibility. This operation is noop for JWTs, as they are only revoked upon expiration.
$this->revocation_handler->revoke( $token_set->get_access_token(), Token_Type_Hint::ACCESS_TOKEN );
if ( $token_set->get_refresh_token() !== null ) {
$this->revocation_handler->revoke( $token_set->get_refresh_token(), Token_Type_Hint::REFRESH_TOKEN );
}
$this->user_token_storage->delete( $user_id );
}