Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting allow_unconfirmed_access_for to nil #2275

Closed
Ajedi32 opened this issue Feb 13, 2013 · 6 comments · Fixed by #2278
Closed

Setting allow_unconfirmed_access_for to nil #2275

Ajedi32 opened this issue Feb 13, 2013 · 6 comments · Fixed by #2278

Comments

@Ajedi32
Copy link

Ajedi32 commented Feb 13, 2013

As you're probably aware, Devise's :confirmable module has a setting called allow_unconfirmed_access_for that determines how long a user can access their account for before they are forced to confirm its email address. Currently, there's no way to remove this restriction entirely like there is for confirm_within. I can work around this by setting allow_unconfirmed_access_for to some ridiculous value like 1000.years, but that feels like a rather dirty solution. I'd prefer to just set it to nil and have that remove the restriction, but currently doing that yields the following error:

undefined method `ago' for nil:NilClass
devise (2.2.2) lib/devise/models/confirmable.rb:162:in `confirmation_period_valid?'
@nashby
Copy link
Collaborator

nashby commented Feb 13, 2013

@Ajedi32 hmmm, I don't follow. If you want to allow unconfirmed access for users all the time why do you need to use confirmable module at all? :)

@Ajedi32
Copy link
Author

Ajedi32 commented Feb 13, 2013

@nashby Because I still want to enable or disable access to certain features of the website based on whether the user has a confirmed email address or not.

@Ajedi32
Copy link
Author

Ajedi32 commented Feb 14, 2013

Wow, that was fast. Thanks. 👍

@lucasprag
Copy link

Nice! =D

@r-a-o
Copy link

r-a-o commented Jul 2, 2016

Please mention the use of nil for allow_unconfirmed_access_for in docs.

I read docs, then googled, then found a StackOverflow answer mentioning the use of value nil.

@jarosan
Copy link

jarosan commented Mar 6, 2017

I'm with @r-a-o. I've just spend a lot more time than i want to admit to figure out my problem was solved by config.allow_unconfirmed_access_for = nil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants