Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit 44d24f5

Browse files
Merge branch '4.0'
* 4.0: [Serializer] optims and cleanup do not mock the container builder in tests [PhpUnitBridge] Added support for PHPUnit 7 in Coverage Listener fix accessing request values Avoid running the remove command without any packages [Form] Add translations for Tagalog
2 parents 408131a + fddc676 commit 44d24f5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Http/Firewall/SimpleFormAuthenticationListener.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,13 @@ protected function attemptAuthentication(Request $request)
8585
}
8686
}
8787

88-
$requestBag = $this->options['post_only'] ? $request->request : $request;
89-
$username = ParameterBagUtils::getParameterBagValue($requestBag, $this->options['username_parameter']);
90-
$password = ParameterBagUtils::getParameterBagValue($requestBag, $this->options['password_parameter']);
88+
if ($this->options['post_only']) {
89+
$username = ParameterBagUtils::getParameterBagValue($request->request, $this->options['username_parameter']);
90+
$password = ParameterBagUtils::getParameterBagValue($request->request, $this->options['password_parameter']);
91+
} else {
92+
$username = ParameterBagUtils::getRequestParameterValue($request, $this->options['username_parameter']);
93+
$password = ParameterBagUtils::getRequestParameterValue($request, $this->options['password_parameter']);
94+
}
9195

9296
if (!\is_string($username) || (\is_object($username) && !\method_exists($username, '__toString'))) {
9397
throw new BadRequestHttpException(sprintf('The key "%s" must be a string, "%s" given.', $this->options['username_parameter'], \gettype($username)));

0 commit comments

Comments
 (0)