Class: Booth::Userland::Otps::Guards::Sudo

Inherits:
Object
  • Object
show all
Includes:
MethodObject
Defined in:
lib/booth/userland/otps/guards/sudo.rb

Instance Method Summary collapse

Methods included from MethodObject

included

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
# File 'lib/booth/userland/otps/guards/sudo.rb', line 11

def call
  return if credential.mode_first_time?
  return if credential.mode_username_and_password?
  return if credential.mode_username_password_and_webauth?
  return if credential.mode_username_and_webauth?

  request.sudo.guard_with_otp { yield _1 }
end