Sha256: 183424208be880c4fbd32fe4764eab37d74f072663ef4c21aca64d5dab3a4b4a

Contents?: true

Size: 489 Bytes

Versions: 29

Compression:

Stored size: 489 Bytes

Contents

# Deny user access whenever their account is not active yet.
# We need this as hook to validate the user activity on each request
# and in case the user is using other strategies beside Devise ones.
Warden::Manager.after_set_user do |record, warden, options|
  if record && record.respond_to?(:active_for_authentication?) && !record.active_for_authentication?
    scope = options[:scope]
    warden.logout(scope)
    throw :warden, scope: scope, message: record.inactive_message
  end
end

Version data entries

29 entries across 29 versions & 6 rubygems

Version Path
devise-4.3.0 lib/devise/hooks/activatable.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/devise-4.2.1/lib/devise/hooks/activatable.rb
devise-4.2.1 lib/devise/hooks/activatable.rb
devise-4.2.0 lib/devise/hooks/activatable.rb
devise-3.5.10 lib/devise/hooks/activatable.rb
devise-4.0.3 lib/devise/hooks/activatable.rb
devise-4.1.1 lib/devise/hooks/activatable.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/devise-4.1.0/lib/devise/hooks/activatable.rb
devise-4.1.0 lib/devise/hooks/activatable.rb
devise-3.5.9 lib/devise/hooks/activatable.rb
devise-4.0.2 lib/devise/hooks/activatable.rb
devise-4.0.1 lib/devise/hooks/activatable.rb
devise-3.5.8 lib/devise/hooks/activatable.rb
devise-3.5.7 lib/devise/hooks/activatable.rb
devise-4.0.0 lib/devise/hooks/activatable.rb
devise-4.0.0.rc2 lib/devise/hooks/activatable.rb
devise-4.0.0.rc1 lib/devise/hooks/activatable.rb
devise-3.5.6 lib/devise/hooks/activatable.rb
devise-3.5.5 lib/devise/hooks/activatable.rb
devise-3.5.4 lib/devise/hooks/activatable.rb