diff options
-rw-r--r-- | Http/Firewall/UsernamePasswordFormAuthenticationListener.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Http/Firewall/UsernamePasswordFormAuthenticationListener.php b/Http/Firewall/UsernamePasswordFormAuthenticationListener.php index bd2cec1..4bcb785 100644 --- a/Http/Firewall/UsernamePasswordFormAuthenticationListener.php +++ b/Http/Firewall/UsernamePasswordFormAuthenticationListener.php @@ -51,6 +51,18 @@ class UsernamePasswordFormAuthenticationListener extends AbstractAuthenticationL } /** + * @{inheritdoc} + */ + protected function requiresAuthentication(Request $request) + { + if ($this->options['post_only'] && !$request->isMethod('post')) { + return false; + } + + return parent::requiresAuthentication($request); + } + + /** * {@inheritdoc} */ protected function attemptAuthentication(Request $request) |