简体   繁体   English

电子邮件验证后自动登录并重定向到“ fos_user_profile_edit”路径

[英]Auto-login after email validation and redirection to 'fos_user_profile_edit' path

We're building a business app from the ground up in Symfony 3, and I've run into a bit of a snag with the user validation flow: after the user creates an account they will receive a validation email, then(after clicking the confirmation/validation link) they should be automatically authentificated and redirected to the edit profile. 我们正在Symfony 3中从头开始构建一个业务应用程序,而我在用户验证流程方面遇到了一些麻烦:用户创建帐户后,他们将收到验证电子邮件,然后(单击确认/确认链接),它们应该被自动认证并重定向到编辑配置文件。
But unfortunately they are redirected to the login page without any authentification. 但不幸的是,它们未经任何身份验证即被重定向到登录页面。

Anyone had any experience with this, or able to point me in the right direction? 任何人都对此有任何经验,或者能够为我指明正确的方向?

Which version of user bunle have you? 您拥有哪个版本的用户Bunle?

It is as folow, If email configuration has been set properly, when user are create ( registerAction ), FOSUserEvents::REGISTRATION_SUCCESS event are dispatch and EmailConfirmationListener catch its and send email with the generated token. 如下所示,如果已经正确设置了电子邮件配置,则在创建用户( registerAction )时,将调度FOSUserEvents :: REGISTRATION_SUCCESS事件,并且EmailConfirmationListener会捕获该事件并使用生成的令牌发送电子邮件。 This token is save in session and user have to be connected by using email confirmation with it related confirmation token confirmAction 此令牌保存在会话中,并且用户必须通过使用电子邮件确认与其相关的确认令牌ConfirmE进行连接

All depend on if admin email is set properly or not have a look there : https://symfony.com/doc/master/bundles/FOSUserBundle/emails.html#registration-confirmation 一切都取决于管理员电子邮件设置是否正确,或者是否在那里查看: https : //symfony.com/doc/master/bundles/FOSUserBundle/emails.html#registration-confirmation

If email has not been set properly addRegistrationSection by default: 如果未正确设置电子邮件,则默认情况下,请添加addRegistrationSection

fos_user:
# ...
    registration:
        confirmation:
            enabled: false

User should be connected directly 用户应直接连接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM