Laurie Young
Laurie Young

Reputation: 138514

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 done this by setting (in devise.rb)

config.confirm_within = 100.years

Is there a nicer way of doing this?

Upvotes: 5

Views: 1311

Answers (3)

Lockyy
Lockyy

Reputation: 344

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

Upvotes: 3

Yossi Shasho
Yossi Shasho

Reputation: 3640

actually in newer versions of devise its

config.allow_unconfirmed_access_for = 100.years

And in my opinion it's an alright solution

Upvotes: 4

grafikchaos
grafikchaos

Reputation: 555

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

Upvotes: -3

Related Questions