class ClientAuthenticator::ApiClient
Public Class Methods
authenticated?(client_id, pass_key)
click to toggle source
# File lib/client_authenticator/model/api_client.rb, line 10 def self.authenticated?(client_id, pass_key) !where(client_id: client_id, pass_key: pass_key).empty? end
Private Instance Methods
generate_pass_key()
click to toggle source
# File lib/client_authenticator/model/api_client.rb, line 16 def generate_pass_key self.pass_key = Digest::SHA1.hexdigest("#{client_id}-#{Time.now.to_i}-#{rand}") end