We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d4f16b2 commit 622c414Copy full SHA for 622c414
application/libraries/Api.php
@@ -77,14 +77,14 @@ public function auth(): void
77
78
$password = $_SERVER['PHP_AUTH_PW'] ?? null;
79
80
+ if (empty($username) || empty($password)) {
81
+ throw new RuntimeException('Missing required credentials', 401);
82
+ }
83
+
84
$user_data = $this->CI->accounts->check_login($username, $password);
85
86
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',
87
- );
+ throw new RuntimeException('The provided credentials do not match any admin user', 401);
88
}
89
} catch (Throwable) {
90
$this->request_authentication();
0 commit comments