Module: DoorkeeperMongodb::Mixins::Mongoid::AccessGrantMixin

Extended by:
ActiveSupport::Concern
Includes:
Doorkeeper::Models::Accessible, Doorkeeper::Models::Expirable, Doorkeeper::Models::Revocable, Doorkeeper::Models::Scopes, Doorkeeper::Models::SecretStorable, Doorkeeper::OAuth::Helpers, Doorkeeper::Orm::Concerns::Mongoid::ResourceOwnerable, BaseMixin, JsonSerializable
Included in:
Doorkeeper::AccessGrant
Defined in:
lib/doorkeeper-mongodb/mixins/mongoid/access_grant_mixin.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Methods included from JsonSerializable

#as_json

Instance Method Details

#pkce_supported?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/doorkeeper-mongodb/mixins/mongoid/access_grant_mixin.rb', line 51

def pkce_supported?
  respond_to? :code_challenge
end

#plaintext_tokenObject



55
56
57
58
59
60
61
# File 'lib/doorkeeper-mongodb/mixins/mongoid/access_grant_mixin.rb', line 55

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

#uses_pkce?Boolean

never uses pkce, if pkce migrations were not generated

Returns:

  • (Boolean)


47
48
49
# File 'lib/doorkeeper-mongodb/mixins/mongoid/access_grant_mixin.rb', line 47

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