From 81e8486870e462a0f52e3e2d6982c84ffbbe6099 Mon Sep 17 00:00:00 2001 From: Jonathan Martz Date: Sat, 7 Jun 2025 09:21:26 +0200 Subject: [PATCH] fix superusers auth --- src/Settings.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Settings.php b/src/Settings.php index f9304ac..9730bc0 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -32,7 +32,8 @@ class Settings $bodyParams['identity'] = $email; $bodyParams['password'] = $password; $output = $this->doRequest($this->url . "/api/collections/_superusers/auth-with-password", 'POST', $bodyParams); - self::$token = json_decode($output, true)['token']; + $data = json_decode($output, true); + self::$token = $data['token'] ?? ''; } public function doRequest(string $url, string $method, $bodyParams = []): string