开发者

Not requiring users to confirm email with Devise

I'm using Devise in a Rails 3 (3.0.5) project. I want to use the confirmable module to allow users to confirm their email address, however I don't want to block them if they do not confirm.

I have currently do开发者_JS百科ne this by setting (in devise.rb)

config.confirm_within = 100.years

Is there a nicer way of doing this?


actually in newer versions of devise its

config.allow_unconfirmed_access_for = 100.years

And in my opinion it's an alright solution


You can now set config.allow_unconfirmed_access_for to nil to allow unconfirmed logins indefinitely whilst still requesting confirmation.

https://github.com/plataformatec/devise/pull/2278 https://github.com/plataformatec/devise/blob/master/lib/devise.rb#L142


Sorry, but I really have to ask why you are using the confirmable module if you are just gonna let them in anyway? What value does the confirmation module bring if you let people slip by?

You might as well say user.confirm! within the create action so you don't have to set a value of 100.years

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜