X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f0b2ed9bb6c1e153231b8088eabe6e3edcee9420..4a38ab5c80d325457a1928d049847d82532f620d:/app/models/request_token.rb?ds=inline diff --git a/app/models/request_token.rb b/app/models/request_token.rb index 335a735bc..ec38f7421 100644 --- a/app/models/request_token.rb +++ b/app/models/request_token.rb @@ -40,8 +40,9 @@ class RequestToken < OauthToken def authorize!(user) return false if authorized? + self.user = user - self.authorized_at = Time.now + self.authorized_at = Time.now.utc self.verifier = OAuth::Helper.generate_key(20)[0, 20] unless oauth10? save end @@ -72,10 +73,10 @@ class RequestToken < OauthToken end def oob? - callback_url.nil? || callback_url.casecmp("oob").zero? + callback_url.nil? || callback_url.casecmp?("oob") end def oauth10? - (defined? OAUTH_10_SUPPORT) && OAUTH_10_SUPPORT && callback_url.blank? + Settings.key?(:oauth_10_support) && Settings.oauth_10_support && callback_url.blank? end end