More Facades, User delete

This commit is contained in:
2024-07-22 00:56:04 +02:00
parent 4b89a7e9ca
commit 7b897071f5
14 changed files with 177 additions and 63 deletions
+5 -3
View File
@@ -3,9 +3,12 @@
namespace Api\Login;
use Exception;
use Khofmann\Api\Api;
use Khofmann\Input\Input;
use Khofmann\Response\Response;
use Khofmann\Models\User\User;
class Login
class Login extends Api
{
public function post()
{
@@ -15,8 +18,7 @@ class Login
if (empty($password)) throw new Exception("Missing Password", 400);
try {
$response = \Khofmann\Models\User\User::logIn($email, $password);
return json_encode($response);
return Response::json(User::logIn($email, $password));
} catch (Exception $err) {
switch ($err->getMessage()) {
case "Failed":