Project import generated by Copybara.

GitOrigin-RevId: 63746295f1a5ab5a619056791995793d65529e62
diff --git a/src/signin.php b/src/signin.php
new file mode 100644
index 0000000..295416c
--- /dev/null
+++ b/src/signin.php
@@ -0,0 +1,23 @@
+<?php
+require_once("core.php");
+
+if (!isset($_POST["username"]) || !isset($_POST["password"]) || empty($_POST["username"]) || empty($_POST["password"])) {
+  security::go("index.php?msg=empty");
+}
+
+switch (security::signIn($_POST["username"], $_POST["password"])) {
+  case security::SIGNIN_STATE_SIGNED_IN:
+  security::redirectAfterSignIn();
+  break;
+
+  case security::SIGNIN_STATE_NEEDS_SECOND_FACTOR:
+  security::go("signinsecondfactor.php");
+  break;
+
+  case security::SIGNIN_STATE_THROTTLED:
+  security::go("index.php?msg=signinthrottled");
+  break;
+
+  default:
+  security::go("index.php?msg=wrong");
+}