Permalink
Browse files

don't use the #web_server method on client

  • Loading branch information...
1 parent 30c94a1 commit b77a31ec6281b7d3d824da9c80f7ae7710f97a27 @bkerley committed Jan 9, 2012
Showing with 10 additions and 10 deletions.
  1. +10 −10 lib/oauth/models/consumers/services/oauth2_token.rb
@@ -1,27 +1,27 @@
require 'oauth2'
class Oauth2Token < ConsumerToken
-
+
def self.consumer
@consumer||=create_consumer
- end
-
+ end
+
def self.create_consumer(options={})
@consumer||=OAuth2::Client.new credentials[:key],credentials[:secret],credentials[:options]
end
-
+
def self.authorize_url(callback_url)
options = {:redirect_uri=>callback_url}
options[:scope] = credentials[:scope] if credentials[:scope].present?
- consumer.web_server.authorize_url(options)
+ consumer.authorize_url(options)
end
-
+
def self.access_token(user, code, redirect_uri)
- access_token = consumer.web_server.get_access_token(code, :redirect_uri => redirect_uri)
+ access_token = consumer.get_token(code, :redirect_uri => redirect_uri)
find_or_create_from_access_token user, access_token
end
-
+
def client
@client ||= OAuth2::AccessToken.new self.class.consumer, token
end
-
-end
+
+end

0 comments on commit b77a31e

Please sign in to comment.