FOSUserBundle SECURITY_IMPLICIT_LOGIN 事件什么时候被触发?
FOSUserBundle When does SECURITY_IMPLICIT_LOGIN event gets fired?
我已阅读 here,您可以看到以下内容:
/**
* 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';
我还阅读了 here,您可以在其中阅读:
"Added an event when logging the user in implicitly"
当该事件被触发时,我不明白是用简单的英语。是用户被记住的时候吗?我注意到,如果您复制我受密码保护的网站的 url 并关闭浏览器选项卡,打开一个新选项卡并将 url 粘贴回来,用户仍然登录(没问题)但没有登录实际发生(FOSUserBundle 不更新 User 实体的 "lastLogin" 字段)。好吧,我明白这是因为会话已经打开了......很酷......sooooooo 该事件何时准确发生,考虑到当用户登录 "normally" 时调用的事件(和方法)是
SecurityEvents::INTERACTIVE_LOGIN => 'onSecurityInteractiveLogin'
谢谢!
SN
快速搜索 github repo show that the only time it is dispatched is in the FOS\UserBundle\EventListener\AuthenticationListener。
这表明 fos_user.security.implicit_login
将在注册 completion/confirmation 和密码重置完成后触发(前提是用户已启用并且可以登录)。
我已阅读 here,您可以看到以下内容:
/**
* 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';
我还阅读了 here,您可以在其中阅读:
"Added an event when logging the user in implicitly"
当该事件被触发时,我不明白是用简单的英语。是用户被记住的时候吗?我注意到,如果您复制我受密码保护的网站的 url 并关闭浏览器选项卡,打开一个新选项卡并将 url 粘贴回来,用户仍然登录(没问题)但没有登录实际发生(FOSUserBundle 不更新 User 实体的 "lastLogin" 字段)。好吧,我明白这是因为会话已经打开了......很酷......sooooooo 该事件何时准确发生,考虑到当用户登录 "normally" 时调用的事件(和方法)是
SecurityEvents::INTERACTIVE_LOGIN => 'onSecurityInteractiveLogin'
谢谢!
SN
快速搜索 github repo show that the only time it is dispatched is in the FOS\UserBundle\EventListener\AuthenticationListener。
这表明 fos_user.security.implicit_login
将在注册 completion/confirmation 和密码重置完成后触发(前提是用户已启用并且可以登录)。