You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
protectedfunction 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 HTTPResponseforeach ($resultsas$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
The text was updated successfully, but these errors were encountered:
…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.
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'sdelegateToMultipleHandlers
method are HTTPResponses, and returning these gives a more helpful error message.Example:
Steps to Reproduce
Go to /Security/login/asdf
The text was updated successfully, but these errors were encountered: