X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f70feedc6517b824c4201584d6298fd5790d85ba..e2f1d6017d3e7c243f3e2cdd84e9dbf8378c22b9:/app/models/request_token.rb?ds=inline diff --git a/app/models/request_token.rb b/app/models/request_token.rb index 0044dde26..6e4ec40c3 100644 --- a/app/models/request_token.rb +++ b/app/models/request_token.rb @@ -6,7 +6,7 @@ class RequestToken < OauthToken return false if authorized? self.user = user self.authorized_at = Time.now - self.verifier = OAuth::Helper.generate_key(16)[0,20] unless oauth10? + self.verifier = OAuth::Helper.generate_key(20)[0,20] unless oauth10? self.save end @@ -21,7 +21,7 @@ class RequestToken < OauthToken params[p] = read_attribute(p) } - access_token = AccessToken.create(params) + access_token = AccessToken.create(params, :without_protection => true) invalidate! access_token end @@ -36,7 +36,7 @@ class RequestToken < OauthToken end def oob? - self.callback_url=='oob' + callback_url.nil? || callback_url.downcase == 'oob' end def oauth10?