在Rails应用程序中单击电子邮件中的链接后自动登录用户? [英] signin user upon clicking the link in email automatically in rails application?
问题描述
我的rails
应用程序中有一个User
模型.这是一个设计"模型.我有一个名为用户信息"的表格,一旦用户登录系统,该表格就可以使用.
I have a User
model in my rails
application. which is a "devise" model. i have one form called "user-info" form this form can be available once the user logs into the system.
我有一个admin
登录名,其中admin
可以将link
发送给用户email
,就像通过单击button
填写用户信息"一样.一旦用户单击按钮,我希望用户登录到系统automatically
而不重定向到登录页面.且应为user-info
形式.
i have one admin
login in which an admin
can send the link
to the user email
like fill the "user info" by clicking a button
. once the user clicks the button i want the user to login into the system automatically
without redirecting to the login page. and should be navigated
to the user-info
form.
我有一个想法,希望在网址中发送查询字符串参数,例如email ="x@gmail.com"&&形式="user_info".但是一旦用户点击此按钮,则需要执行什么才能达到我的要求.
i have an idea of sending query string parameters in the url like email = "x@gmail.com "&& form = "user_info". but once the user clicks on this what needs to be implemented to achieve my requirement.
推荐答案
您可以使用此简单令牌身份验证 gem,众所周知,它会生成身份验证令牌并通过电子邮件发送给您想要进行此身份验证的用户.请按照安装说明进行操作.
You can use this Simple Token Authentication gem, it is well known to generate the authentication token and to be sent by email to the users you would like to have this authentication. please follow the setup instruction.
这篇关于在Rails应用程序中单击电子邮件中的链接后自动登录用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!