class Hello::Business::Authentication::SudoModeAuthentication

Attributes

access[R]

Public Class Methods

new(access) click to toggle source
# File lib/hello/business/authentication/sudo_mode_authentication.rb, line 7
def initialize(access)
  @access = access
end

Public Instance Methods

authenticate!(password) click to toggle source
# File lib/hello/business/authentication/sudo_mode_authentication.rb, line 11
def authenticate!(password)
  if access.user.password_is?(password)
    access.update!(sudo_expires_at: sudo_expires_at)
  end
end

Private Instance Methods

sudo_expires_at() click to toggle source
# File lib/hello/business/authentication/sudo_mode_authentication.rb, line 19
def sudo_expires_at
  Hello.configuration.sudo_expires_in.from_now
end