silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
721 stars 821 forks source link

[User Warning] Authenticator "default" doesn't support tabbed forms for Security Actions #11087

Open tiller1010 opened 10 months ago

tiller1010 commented 10 months ago

Affected Version

4.x

Description

The error message: [User Warning] Authenticator "default" doesn't support tabbed forms is given if any nonexistent /Security/login action is attempted. Sometimes the $results inside of Security's delegateToMultipleHandlers method are HTTPResponses, and returning these gives a more helpful error message.

Example:

protected function delegateToMultipleHandlers(array $handlers, $title, array $templates, callable $aggregator)
{
    ...
    // Process each of the handlers
    $results = array_map(
        function (RequestHandler $handler) {
            return $handler->handleRequest($this->getRequest());
        },
        $handlers
    );

    // Loop through results, return any HTTPResponse
    foreach ($results as $result) {
        if ($result instanceof HTTPResponse) {
            return $result; // Gives "Action 'asdf' isn't available on class SilverStripe\MFA\Authenticator\LoginHandler."
        }
    }

Steps to Reproduce

Go to /Security/login/asdf