diff --git a/src/controllers/api/Sessions.php b/src/controllers/api/Sessions.php new file mode 100644 index 0000000..48d559c --- /dev/null +++ b/src/controllers/api/Sessions.php @@ -0,0 +1,54 @@ +verifyPassword($password)) { + http_response_code(401); + die(); + } + + $_SESSION['admin_email'] = $email; + session_regenerate_id(); + } + + public function index(): void + { + switch ($_SERVER['REQUEST_METHOD']) { + case 'POST': + $this->handleLogin(); + break; + default: + http_response_code(400); + die(); + } + } +} \ No newline at end of file