From 5cbe16c3d2a3a3667021fb8c81f743308aefbdae Mon Sep 17 00:00:00 2001 From: Alex Buijs Date: Wed, 31 Jul 2019 16:48:38 +0200 Subject: Set Devise's allow_unconfirmed_access_for to 30 days --- app/models/user.rb | 7 +++++++ config/initializers/8_devise.rb | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index ac83c8e3256..4adc44a9375 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1505,6 +1505,13 @@ class User < ApplicationRecord super end + # override from Devise::Confirmable + def confirmation_period_valid? + return false if Feature.disabled?(:soft_email_confirmation) + + super + end + private def default_private_profile_to_false diff --git a/config/initializers/8_devise.rb b/config/initializers/8_devise.rb index 3dd12c7e64d..8ef9ff6b7fc 100644 --- a/config/initializers/8_devise.rb +++ b/config/initializers/8_devise.rb @@ -81,7 +81,7 @@ Devise.setup do |config| # You can use this to let your user access some features of your application # without confirming the account, but blocking it after a certain period # (ie 2 days). - # config.allow_unconfirmed_access_for = 2.days + config.allow_unconfirmed_access_for = 30.days # Defines which key will be used when confirming an account # config.confirmation_keys = [ :email ] -- cgit v1.2.1