Module: Huberry::Authentication::ModelMethods::ClassMethods

Defined in:
lib/huberry/authentication/model_methods.rb

Instance Method Summary collapse

Instance Method Details

#authenticate(login, password) ⇒ Object



30
31
32
33
# File 'lib/huberry/authentication/model_methods.rb', line 30

def authenticate(, password)
  user = send("find_by_#{self.authentication_options[:login_field]}", )
  user && user.authenticated?(password) ? user : false
end

#digest(str) ⇒ Object



35
36
37
# File 'lib/huberry/authentication/model_methods.rb', line 35

def digest(str)
  Digest::SHA256.hexdigest(str.to_s)
end