When an already authenticated user attempts to log in again, the following errors are triggered:
|Symfony\Component\HttpKernel\Exception\ControllerDoesNotReturnResponseException: The controller must return a "Symfony\Component\HttpFoundation\Response" object but it returned a boolean value (false). in () (line 98 of /docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php)
Warning: Undefined array key "function" in Drupal\Core\Utility\Error::getLastCaller() (line 150 of /docroot/core/lib/Drupal/Core/Utility/Error.php)
Steps to Reproduce:
- Log in to the site as a user.
- Attempt to access the login page or submit a login request again.
Expected Behavior:
- The system should handle the login attempt gracefully, e.g., display a message that the user is already logged in.
- No exceptions or warnings should be triggered.
Actual Behavior:
- The controller returns false instead of a Response object.
- The system throws a ControllerDoesNotReturnResponseException.
- A warning about an undefined array key appears in the logs.