File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 55use App \Model \AbstractUser ;
66use Doctrine \ORM \EntityManagerInterface ;
77use Symfony \Component \Security \Core \Encoder \UserPasswordEncoderInterface ;
8+ use Symfony \Component \Security \Guard \Token \PostAuthenticationGuardToken ;
89use Symfony \Component \Security \Http \Event \InteractiveLoginEvent ;
910
1011/**
@@ -66,6 +67,16 @@ public function __construct(
6667 */
6768 public function onSecurityInteractiveLogin (InteractiveLoginEvent $ event ): void
6869 {
70+ /*
71+ * onSecurityInteractiveLogin event is fired not only by a successful login (PostAuthenticationGuardToken) but
72+ * also by an authentication through remember me token (RememberMeToken).
73+ * But $event->getRequest()->request->get('password') is obviously empty during the later, thus crashing this
74+ * event listener.
75+ */
76+ if (get_class ($ event ->getAuthenticationToken ()) !== PostAuthenticationGuardToken::class) {
77+ return ;
78+ }
79+
6980 /**
7081 * @var AbstractUser $user
7182 */
You can’t perform that action at this time.
0 commit comments