Module: Huberry::Authentication::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#authenticate(login, password) ⇒ Object



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

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

#digest(str) ⇒ Object



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

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