diff --git a/application/libraries/Api.php b/application/libraries/Api.php index eaf2fff6..44df3c71 100644 --- a/application/libraries/Api.php +++ b/application/libraries/Api.php @@ -79,9 +79,9 @@ class Api { $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'); }