This commit is contained in:
Pedro Silva 2024-04-16 17:11:59 +01:00
parent 86be3055c5
commit 80f8edb594
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3

View file

@ -70,7 +70,9 @@ class SdkClientToken {
*/ */
public function sdk_client_token( string $target_customer_id = '' ): string { public function sdk_client_token( string $target_customer_id = '' ): string {
$bearer = $this->bearer->bearer(); $bearer = $this->bearer->bearer();
$domain = $_SERVER['HTTP_HOST'];
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$domain = wp_unslash( $_SERVER['HTTP_HOST'] ?? '' );
$url = trailingslashit( $this->host ) . 'v1/oauth2/token?grant_type=client_credentials&response_type=client_token&intent=sdk_init&domains[]=*.' . $domain; $url = trailingslashit( $this->host ) . 'v1/oauth2/token?grant_type=client_credentials&response_type=client_token&intent=sdk_init&domains[]=*.' . $domain;