Register endpoint

This commit is contained in:
2024-07-22 02:21:30 +02:00
parent d94c342bd6
commit af588ab174
9 changed files with 192 additions and 43 deletions
+3 -3
View File
@@ -15,7 +15,7 @@ class Login extends Api
$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);
if (empty($password)) throw new Exception("Missing password", 400);
try {
return Response::json(User::logIn($email, $password));
@@ -24,9 +24,9 @@ class Login extends Api
case "Failed":
throw new Exception("Login failed", 500);
case "NotFound":
throw new Exception("User not Found", 404);
throw new Exception("User not found", 404);
case "Invalid":
throw new Exception("Invalid Username or Password", 401);
throw new Exception("Invalid username or password", 401);
default:
throw $err;
}