Skip to content

Errors/Warning on login Controller returns boolean instead of Response when signed-in user attempts login #161

@JiGzSaw01

Description

@JiGzSaw01

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions