class Doorkeeper::Application

def self.authorized_for(resource_owner)

Returns:
  • (ActiveRecord::Relation) -

Parameters:
  • resource_owner (ActiveRecord::Base) --
def self.authorized_for(resource_owner)
  resource_access_tokens = AccessToken.active_for(resource_owner)
  where(id: resource_access_tokens.select(:application_id).distinct)
end

def generate_secret

def generate_secret
  self.secret = UniqueToken.generate if secret.blank?
end

def generate_uid

def generate_uid
  self.uid = UniqueToken.generate if uid.blank?
end