mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-10-13 16:03:43 +00:00
Issue 21958 php-slim4 throws exception (#21962)
authenticatorConfig was being overwritten instead of having additional fields added. Changed the reqex from requiring leading whitespace to having it optional.
This commit is contained in:
parent
1c950018c8
commit
ec0edf433a
@ -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'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user