Class: Booth::Cooldowns::Password

Inherits:
Object
  • Object
show all
Includes:
MethodObject
Defined in:
lib/booth/cooldowns/password.rb

Instance Method Summary collapse

Methods included from MethodObject

included

Instance Method Details

#callObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/booth/cooldowns/password.rb', line 9

def call
  # No limit for logins where hardware tokens are required.
  return Tron.success :cool_for_webauth if credential.mode_username_and_webauth?
  return Tron.success :cool_for_password_and_webauth if credential.mode_username_password_and_webauth?

  if credential.mode_username_password_and_otp?
    do_check_exponentially
  else
    do_check_globally
  end
end