문제

We need to catch the login data that have extra information as captcha inputs and more. When we do login we lost this $_POST information in loginListener so we can't process some data to the database.

The only function that we found to implement some code to access to the database before login and catch some POST data in it, is at the attemptAuthentication function of UsernamePasswordFormAuthenticationListener class, in file:

vendor/symfony/src/Symfony/Component/Security/Http/Firewall/UsernamePasswordFormAuthenticationListener.php

But it is core code and we think is a bad practice if we have to modify this.

We need to find a BeforeLogin function and file in Symfony 2 to implement the database access code.

도움이 되었습니까?

해결책

You can register a listener for SecurityEvents::INTERACTIVE_LOGIN and get the request from the event object.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top