X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7dbf8d83369cb73929080c4ba23fdd7dcd0184df..71b21ec47371c7210dfcb234f7bfa0adf00efad1:/app/models/client_application.rb diff --git a/app/models/client_application.rb b/app/models/client_application.rb index ef1a0110e..d11942beb 100644 --- a/app/models/client_application.rb +++ b/app/models/client_application.rb @@ -51,12 +51,13 @@ class ClientApplication < ActiveRecord::Base def self.find_token(token_key) token = OauthToken.includes(:client_application).find_by(:token => token_key) - token if token && token.authorized? + token if token&.authorized? end def self.verify_request(request, options = {}, &block) signature = OAuth::Signature.build(request, options, &block) return false unless OauthNonce.remember(signature.request.nonce, signature.request.timestamp) + value = signature.verify value rescue OAuth::Signature::UnknownSignatureMethod