fix api urls

This commit is contained in:
2026-07-22 16:11:45 +02:00
parent 48c120ab01
commit 8c61b69320
2 changed files with 5 additions and 4 deletions
@@ -23,7 +23,8 @@ class ElixFormsAuthenticationClient {
* @throws ElixFormsException Se le credenziali sono errate o c'è un errore server
*/
public function login(string $username, string $password): string {
$url = $this->baseUrl . '/eF/services/api/authentication/login/v1';
$this->baseUrl = rtrim($this->baseUrl,'/');
$url = "{$this->baseUrl}/services/api/authentication/login/v1";
try {
$response = $this->httpClient->post($url, [
@@ -64,7 +65,7 @@ class ElixFormsAuthenticationClient {
* @throws ElixFormsException Se c'è un errore durante il logout
*/
public function logout(string $username, string $token): bool {
$url = $this->baseUrl . '/eF/services/api/authentication/' . urlencode($username) . '/logout/v1';
$url = "{$this->baseUrl}/services/api/authentication/" . urlencode($username) . '/logout/v1';
try {
$response = $this->httpClient->post($url, [