Make API responses uniform

This commit is contained in:
DariusIII
2026-04-25 10:23:05 +02:00
parent 3987655051
commit f3a707e41b
17 changed files with 330 additions and 110 deletions
+6 -2
View File
@@ -98,7 +98,11 @@ class GetNzbController extends BasePageController
*/
private function getUserDataFromSession(): array|Response
{
if ($this->userdata->hasRole('Disabled')) {
if (! $this->userdata->hasVerifiedEmail()) {
return showApiError(100);
}
if ($this->userdata->is_disabled || $this->userdata->hasRole('Disabled')) {
return showApiError(101);
}
@@ -126,7 +130,7 @@ class GetNzbController extends BasePageController
return showApiError(100);
}
if ($user->hasRole('Disabled')) {
if ($user->is_disabled || $user->hasRole('Disabled')) {
return showApiError(101);
}