MVC: call initialize() after authentication, which is the same as it was in Phalcon earlier.

This fixes a small regression not being able to access user data during init and prevents executing code before the user is authenticated, although in practice this is only boilerplate in our codebase.
This commit is contained in:
Ad Schellevis 2024-12-16 16:51:33 +01:00
parent c5ef6d5fe8
commit dd595b9a78

View File

@ -157,11 +157,12 @@ class Dispatcher
$controller->response = $response;
$controller->security = new Security($session, $request);
$controller->initialize();
if ($controller->beforeExecuteRoute($this) === false) {
return false;
}
/* call initialize() after authentication */
$controller->initialize();
$this->returnedValue = $controller->{$this->action}(...$this->parameters);
$session->close();
$controller->afterExecuteRoute($this);