mirror of
https://github.com/getformwork/formwork.git
synced 2025-02-23 01:02:46 +01:00
Do all loading before request validation
This commit is contained in:
parent
6d279534bb
commit
a4514c97ba
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user