Rails:注册后设计登录 [英] Rails: Devise login after sign up

查看:82
本文介绍了Rails:注册后设计登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Devise来实现用户注册/登录.我希望用户在成功注册后能够自动登录.我怎样才能做到这一点.可能是默认情况下进行设计的情况,但后来我在某处禁用了该设置.我不记得了...

I'm using Devise to implement user signup/login. I want the user to be able to login automatically after a successful sign up. How can I do that. It might be the case that Devise this by default, but then maybe I disabled that setting somewhere. I can't remember...

推荐答案

我认为您已启用Devise设置中的可确认的确认" 模块.

I think you have enabled the Devise Confirmable module in your Devise setup.

在这种情况下,您可以删除可确认的模块,也可以允许用户在特定时期内未经确认的访问权限.

If that is the case, you can either remove the confirmable module or you can allow users to have unconfirmed access for a specific period.

在您的config/initializers/devise.rb中:

config.allow_unconfirmed_access_for = 2.days

这篇关于Rails:注册后设计登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆