Sha256: 752ad9e5656e5bc4ffe7fbe8e9adac7d994cff5f22c8124c1b234bbc6c656eab
Contents?: true
Size: 683 Bytes
Versions: 83
Compression:
Stored size: 683 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_for_authentication? # 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_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
83 entries across 77 versions & 9 rubygems