Module: Doorkeeper::ApplicationMixin
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/doorkeeper/models/application_mixin.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#redirect_uri=(uris) ⇒ String
Set an application’s valid redirect URIs.
-
#secret_matches?(input) ⇒ Boolean
Check whether the given plain text secret matches our stored secret.
Methods included from Models::Scopes
#includes_scope?, #scopes, #scopes=, #scopes_string
Instance Method Details
#redirect_uri=(uris) ⇒ String
Set an application’s valid redirect URIs.
67 68 69 |
# File 'lib/doorkeeper/models/application_mixin.rb', line 67 def redirect_uri=(uris) super(uris.is_a?(Array) ? uris.join("\n") : uris) end |
#secret_matches?(input) ⇒ Boolean
Check whether the given plain text secret matches our stored secret
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/doorkeeper/models/application_mixin.rb', line 79 def secret_matches?(input) # return false if either is nil, since secure_compare depends on strings # but Application secrets MAY be nil depending on confidentiality. return false if input.nil? || secret.nil? # When matching the secret by comparer function, all is well. return true if secret_strategy.secret_matches?(input, secret) # When fallback lookup is enabled, ensure applications # with plain secrets can still be found if fallback_secret_strategy fallback_secret_strategy.secret_matches?(input, secret) else false end end |