找到你要的答案

Q:FOSUserBundle When does SECURITY_IMPLICIT_LOGIN event gets fired?

Q:FOSUserBundle什么时候security_implicit_login事件被开除?

I've read here and you can see the following:

/**
 * The SECURITY_IMPLICIT_LOGIN event occurs when the user is logged in programmatically.
 *
 * This event allows you to access the response which will be sent.
 * The event listener method receives a FOS\UserBundle\Event\UserEvent instance.
 */
const SECURITY_IMPLICIT_LOGIN = 'fos_user.security.implicit_login'; 

I've also read here where you can read:

"Added an event when logging the user in implicitly"

What I don't understand is in plain english when that event gets fired. Is it when the user is remembered? I noticed that if you copy the url of my password protected website and close the browser tab, open a new tab and paste the url back, the user is still logged (which is ok) but no logging actually occurs (FOSUserBundle does not update the "lastLogin" field of the User entity). Ok, I understand this is because the session was already open...cool...sooooooo when does that event occur exactly, considering that the event (and method) that gets called when the user signs in "normally" is

SecurityEvents::INTERACTIVE_LOGIN => 'onSecurityInteractiveLogin'

Thank you!

SN

我在这里阅读,你可以看到以下:

/**
 * The SECURITY_IMPLICIT_LOGIN event occurs when the user is logged in programmatically.
 *
 * This event allows you to access the response which will be sent.
 * The event listener method receives a FOS\UserBundle\Event\UserEvent instance.
 */
const SECURITY_IMPLICIT_LOGIN = 'fos_user.security.implicit_login'; 

我也读过你可以读的地方:

"Added an event when logging the user in implicitly"

我不明白的是简单的英语时,该事件被解雇。是当用户被记住?我注意到,如果你复制我的密码保护的网站的URL和关闭浏览器选项卡,打开一个新标签,粘贴网址后,用户仍然使用(这是好的)但没有记录实际发生的(FOSUserBundle不更新的用户实体的“lastlogin场”)。好的,我明白这是因为会议已经开…酷…sooooooo当那事件发生地,考虑到事件(和方法)被称为在“正常”用户的迹象

SecurityEvents::INTERACTIVE_LOGIN => 'onSecurityInteractiveLogin'

谢谢您!

answer1: 回答1:

A quick search on the github repo show that the only time it is dispatched is in the FOS\UserBundle\EventListener\AuthenticationListener.

This shows that the fos_user.security.implicit_login would be triggered after registration completion/confirmation and password reset completion (providing the user is enabled and can be logged in).

快速搜索在GitHub的回购表明,唯一的一次是派遣在FOS \ userbundle \上\ authenticationlistener。

这表明,fos_user.security.implicit_login将完成登记/确认和密码重置完成后触发(为用户启用可登录)。

symfony2  fosuserbundle