add better http code for invalid api credentials and suspended users

This commit is contained in:
osaajani 2021-01-16 23:49:40 +01:00
parent 063a8a899d
commit 730ac8963b
1 changed files with 2 additions and 2 deletions

View File

@ -87,7 +87,7 @@ namespace controllers\publics;
$return = self::DEFAULT_RETURN;
$return['error'] = self::ERROR_CODES['INVALID_CREDENTIALS'];
$return['message'] = self::ERROR_MESSAGES['INVALID_CREDENTIALS'];
$this->auto_http_code(false);
$this->set_http_code(401);
$this->json($return);
exit(self::ERROR_CODES['INVALID_CREDENTIALS']);
@ -98,7 +98,7 @@ namespace controllers\publics;
$return = self::DEFAULT_RETURN;
$return['error'] = self::ERROR_CODES['SUSPENDED_USER'];
$return['message'] = self::ERROR_MESSAGES['SUSPENDED_USER'];
$this->auto_http_code(false);
$this->set_http_code(403);
$this->json($return);
exit(self::ERROR_CODES['SUSPENDED_USER']);