mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-22 09:26:27 +02:00
add better http code for invalid api credentials and suspended users
This commit is contained in:
parent
063a8a899d
commit
730ac8963b
1 changed files with 2 additions and 2 deletions
|
@ -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']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue