Class: Fortifier::AuthSteps::CheckForBlockedIp

Inherits:
Object
  • Object
show all
Defined in:
app/models/fortifier/auth_steps/check_for_blocked_ip.rb

Class Method Summary collapse

Class Method Details

.invoke(params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/models/fortifier/auth_steps/check_for_blocked_ip.rb', line 8

def self.invoke(params)
  auth_user = params[:auth_user]
  remote_addr = params[:remote_addr]
   = params[:account]
  ip_blocked = AuthLog.block_ip?(remote_addr)
  if ip_blocked
    # TODO: (DK) ? auth_log.destroy # this is so one user can't block an IP
    NotifierMailer.(auth_user, remote_addr, ).deliver
    NotifierMailer.(auth_user, remote_addr, ).deliver
  end
  params.merge! auth_msg: ip_blocked ? Messaging::IP_BLOCKED : nil
end

.skip_step?(params) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'app/models/fortifier/auth_steps/check_for_blocked_ip.rb', line 4

def self.skip_step?(params)
  params[:auth_msg].present?
end