mirror of
https://github.com/standardebooks/web.git
synced 2025-07-16 03:16:36 -04:00
Use HTTP code enums instead of ints
This commit is contained in:
parent
3f822b85c3
commit
3050ab7219
28 changed files with 56 additions and 56 deletions
|
@ -14,18 +14,18 @@ $redirect = HttpInput::Str(SESSION, 'redirect') ?? HttpInput::Str(GET, 'redirect
|
|||
$exception = $_SESSION['exception'] ?? null;
|
||||
$passwordRequired = false;
|
||||
|
||||
http_response_code(401);
|
||||
http_response_code(Enums\HttpCode::Unauthorized->value);
|
||||
|
||||
if($exception){
|
||||
if($exception instanceof Exceptions\PasswordRequiredException){
|
||||
// This login requires a password to proceed.
|
||||
// Prompt the user for a password.
|
||||
http_response_code(401);
|
||||
http_response_code(Enums\HttpCode::Unauthorized->value);
|
||||
$passwordRequired = true;
|
||||
$exception = null; // Clear the exception so we don't show an error
|
||||
}
|
||||
else{
|
||||
http_response_code(422);
|
||||
http_response_code(Enums\HttpCode::UnprocessableContent->value);
|
||||
}
|
||||
session_unset();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue