Sha256: 491bbf8e490f308970e5e44dc1df18c0e9d9bad7268cbfaf8d7188a6612e12db

Contents?: true

Size: 520 Bytes

Versions: 24

Compression:

Stored size: 520 Bytes

Contents

# frozen_string_literal: true

# 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

24 entries across 23 versions & 4 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/devise-4.9.4/lib/devise/hooks/activatable.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/devise-4.9.4/lib/devise/hooks/activatable.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/devise-4.9.4/lib/devise/hooks/activatable.rb
devise-4.9.4 lib/devise/hooks/activatable.rb
devise-4.9.3 lib/devise/hooks/activatable.rb
devise-4.9.2 lib/devise/hooks/activatable.rb
devise-4.9.1 lib/devise/hooks/activatable.rb
devise-4.9.0 lib/devise/hooks/activatable.rb
devise-4.8.1 lib/devise/hooks/activatable.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/devise-4.8.0/lib/devise/hooks/activatable.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/devise-4.8.0/lib/devise/hooks/activatable.rb
devise-4.8.0 lib/devise/hooks/activatable.rb
devise-4.7.3 lib/devise/hooks/activatable.rb
devise-4.7.2 lib/devise/hooks/activatable.rb
devise-4.7.1 lib/devise/hooks/activatable.rb
devise-4.7.0 lib/devise/hooks/activatable.rb
devise-4.6.2 lib/devise/hooks/activatable.rb
devise-4.6.1 lib/devise/hooks/activatable.rb
devise-4.6.0 lib/devise/hooks/activatable.rb
devise-4.5.0 lib/devise/hooks/activatable.rb