Sha256: 7c142c01f2c3a6359e73242cffeef8cb4630f504cf2c52a0613691a7fbcd7c1b
Contents?: true
Size: 626 Bytes
Versions: 50
Compression:
Stored size: 626 Bytes
Contents
# Deny user access whenever his account is not active yet. All strategies that inherits from # Devise::Strategies::Authenticatable and uses the validate already check if the user is active? # before actively signing him in. However, we need this as hook to validate the user activity # in 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?) && !record.active? scope = options[:scope] warden.logout(scope) throw :warden, :scope => scope, :message => record.inactive_message end end
Version data entries
50 entries across 50 versions & 8 rubygems