Image now a file

This commit is contained in:
2024-07-21 18:28:19 +02:00
parent 8d91e805dd
commit b3c5841e36
17 changed files with 346 additions and 36 deletions
+8 -1
View File
@@ -9,8 +9,13 @@ class Login
{
public function post()
{
$email = Input::post("email");
if (empty($email)) throw new Exception("Missing email", 400);
$password = Input::post("password");
if (empty($password)) throw new Exception("Missing Password", 400);
try {
$response = \Khofmann\Models\User\User::logIn(Input::post("email"), Input::post("password"));
$response = \Khofmann\Models\User\User::logIn($email, $password);
return json_encode($response);
} catch (Exception $err) {
switch ($err->getMessage()) {
@@ -20,6 +25,8 @@ class Login
throw new Exception("User not Found", 404);
case "Invalid":
throw new Exception("Invalid Username or Password", 401);
default:
throw $err;
}
}
}