Image now a file
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user