diff --git a/formwork/src/Admin/Admin.php b/formwork/src/Admin/Admin.php index c1f0f0c1..e2096d5d 100644 --- a/formwork/src/Admin/Admin.php +++ b/formwork/src/Admin/Admin.php @@ -99,11 +99,6 @@ final class Admin */ public function run(): void { - if (HTTPRequest::method() === 'POST') { - $this->validateContentLength(); - $this->validateCSRFToken(); - } - $this->loadSchemes(); $this->users = Users::load(); @@ -113,6 +108,11 @@ final class Admin $this->loadRoutes(); + if (HTTPRequest::method() === 'POST') { + $this->validateContentLength(); + $this->validateCSRFToken(); + } + if ($this->users->isEmpty()) { $this->registerAdmin(); }