module Doorkeeper::ApplicationMixin
def secret_matches?(input)
-
(true)
- Whether the given secret matches the stored secret
Parameters:
-
input
(#to_s
) -- Plain secret provided by user
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