Skip to content

Commit

Permalink
Add method to set the sessionToken
Browse files Browse the repository at this point in the history
  • Loading branch information
inserve-paul committed May 1, 2024
1 parent 39e3d30 commit 7dd60fd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/MarketplaceAPIClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,18 @@ public function authenticate(string $username, #[SensitiveParameter] string $pas
{
$loginData = json_encode(compact('username', 'password'));
$sessionToken = (string) $this->apiClient->call('GetSessionToken', (string) $loginData);
$this->apiClient->setSessionToken($sessionToken);
$this->setSessionToken($sessionToken);

return $sessionToken;
}

/**
* @param string $sessionToken
*
* @return void
*/
public function setSessionToken(#[SensitiveParameter] string $sessionToken): void
{
$this->apiClient->setSessionToken($sessionToken);
}
}

0 comments on commit 7dd60fd

Please sign in to comment.