diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache index fcf59e8aaf3..527bdb3380f 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache @@ -197,25 +197,25 @@ class RegisterRoutes $authenticatorConfig = [ 'path' => '/', 'authenticator' => new ApiKeyAuthenticator, - 'regex' => '/\s+(.*)$/i', + 'regex' => '/\s*(.*)$/i', 'argument' => null, 'attribute' => 'authorization_token', 'error' => ['{{authPackage}}\ApiKeyAuthenticator', 'handleUnauthorized'], ]; if ($authMethod['isKeyInHeader']) { - $authenticatorConfig = [ + $authenticatorConfig += [ 'header' => $authMethod['keyParamName'], 'parameter' => null, 'cookie' => null, ]; } else if ($authMethod['isKeyInQuery']) { - $authenticatorConfig = [ + $authenticatorConfig += [ 'header' => null, 'parameter' => $authMethod['keyParamName'], 'cookie' => null, ]; } else if ($authMethod['isKeyInCookie']) { - $authenticatorConfig = [ + $authenticatorConfig += [ 'header' => null, 'parameter' => null, 'cookie' => $authMethod['keyParamName'],