X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/cb87f02642d0097ebc067ca1f9371dde274a41e3..64816e50b57ced52f5fb0082f97b2844e002cf11:/app/models/client_application.rb diff --git a/app/models/client_application.rb b/app/models/client_application.rb index 67b86417a..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 @@ -68,11 +69,11 @@ class ClientApplication < ActiveRecord::Base end def oauth_server - @oauth_server ||= OAuth::Server.new("http://" + SERVER_URL) + @oauth_server ||= OAuth::Server.new("https://" + SERVER_URL) end def credentials - @oauth_client ||= OAuth::Consumer.new(key, secret) + @credentials ||= OAuth::Consumer.new(key, secret) end def create_request_token(_params = {})