This commit is contained in:
2024-07-29 22:06:57 +02:00
parent 5ce2215e44
commit 6a62ae58fc
22 changed files with 670 additions and 7 deletions
+15
View File
@@ -9,8 +9,23 @@ use Khofmann\Input\Input;
use Khofmann\Response\Response;
use Khofmann\Models\User\User;
/**
* Login route handlers
*/
class Login extends Api
{
/**
* Login POST handler
*
* Log in a user. Required inputs are `email` and `password`.
*
* Returns user and tokens
*
* @throws 400 Missing field
* @throws 401 Invalid credentials (login fails)
* @throws 404 User not found
* @throws 500 Failed to log in user
*/
public function post(): void
{
// Fetch all required inputs.