Sha256: 0fe2eda481183aaec23278ef4a11b672ce72c8fe0eb3cc899c9c65596cbc2897

Contents?: true

Size: 486 Bytes

Versions: 4

Compression:

Stored size: 486 Bytes

Contents

# frozen_string_literal: true

module Doorkeeper
  class AccessGrant < Sequel::Model(:oauth_access_grants)
    include DoorkeeperSequel::AccessGrantMixin

    def plaintext_token
      if secret_strategy.allows_restoring_secrets?
        secret_strategy.restore_secret(self, :token)
      else
        @raw_token
      end
    end

    def uses_pkce?
      pkce_supported? && code_challenge.present?
    end

    def pkce_supported?
      respond_to?(:code_challenge)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
doorkeeper-sequel-2.4.0 lib/doorkeeper/orm/sequel/access_grant.rb
doorkeeper-sequel-2.3.0 lib/doorkeeper/orm/sequel/access_grant.rb
doorkeeper-sequel-2.2.0 lib/doorkeeper/orm/sequel/access_grant.rb
doorkeeper-sequel-2.1.0 lib/doorkeeper/orm/sequel/access_grant.rb