Sha256: 0d66d2976d63024b15b3919e30a4b4bac47b4166558ccf716b22fe120520eb26

Contents?: true

Size: 692 Bytes

Versions: 1

Compression:

Stored size: 692 Bytes

Contents

module Doorkeeper
  class AccessToken < BaseRecord
    self.table_name = "#{table_name_prefix}oauth_access_tokens#{table_name_suffix}".to_sym

    include AccessTokenMixin

    # Searches for not revoked Access Tokens associated with the
    # specific Resource Owner.
    #
    # @param resource_owner [ActiveRecord::Base]
    #   Resource Owner model instance
    #
    # @return [ActiveRecord::Relation]
    #   active Access Tokens for Resource Owner
    #
    def self.active_for(resource_owner)
      where(resource_owner_id: resource_owner.id, revoked_at: nil)
    end

    def self.refresh_token_revoked_on_use?
      column_names.include?('previous_refresh_token')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
doorkeeper-4.3.0 lib/doorkeeper/orm/active_record/access_token.rb