diff --git a/application/libraries/Api.php b/application/libraries/Api.php index eaf2fff626..44df3c7139 100644 --- a/application/libraries/Api.php +++ b/application/libraries/Api.php @@ -79,9 +79,9 @@ public function auth(): void $password = $_SERVER['PHP_AUTH_PW'] ?? NULL; - $userdata = $this->CI->accounts->check_login($username, $password); + $user_data = $this->CI->accounts->check_login($username, $password); - if (empty($userdata['role_slug']) || $userdata['role_slug'] !== DB_SLUG_ADMIN) + if (empty($user_data['role_slug']) || $user_data['role_slug'] !== DB_SLUG_ADMIN) { throw new RuntimeException('The provided credentials do not match any admin user!', 401, 'Unauthorized'); }