Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tiller1010 opened this issue Dec 8, 2023 · 0 comments

Comments

@tiller1010
Copy link
Contributor

tiller1010 commented Dec 8, 2023

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

martin-lechene added a commit to martin-lechene/silverstripe-framework that referenced this issue Dec 13, 2023
…s in delegateToMultipleHandlers

Fix issue silverstripe#11087

In the `delegateToMultipleHandlers` method of the Security class, modified the logic to check for the presence of HTTPResponse instances in the results array. If any handler returns an HTTPResponse (e.g., for actions that aren't available), the method now directly returns that response, providing a more informative error message.

This change simplifies the handling of HTTPResponse instances, improving the user experience when attempting nonexistent actions.
martin-lechene added a commit to martin-lechene/silverstripe-framework that referenced this issue Dec 13, 2023
…legateToMultipleHandlers

This commit addresses issue silverstripe#11087 by enhancing the error handling in the delegateToMultipleHandlers method of the Security class. Previously, attempting a nonexistent action would generate a generic warning. With this modification, the method now checks for the presence of an HTTPResponse in the results array and returns it directly, providing a more informative error message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants