Permalink
Browse files

trying to make it work

  • Loading branch information...
1 parent ab53b9b commit 5dfce73049bc3b77cc538cbdfa38bec89495e977 @ballantyne committed Oct 29, 2011
Showing with 9 additions and 5 deletions.
  1. +9 −5 lib/omniauth/strategies/weibo.rb
@@ -5,14 +5,18 @@ module OmniAuth
module Strategies
class Weibo < OmniAuth::Strategies::OAuth
option :name, 'weibo'
- option :client_options, {:site => 'http://api.t.sina.com.cn' }
- # option :sign_in, true
- # option :force_sign_in, false
+ option :sign_in, true
def initialize(*args)
super
- options.client_options[:authorize_path] = '/oauth/authenticate' if options.sign_in?
- options.authorize_params[:force_sign_in] = 'true' if options.force_sign_in?
+ options.client_options[:authorize_path] = '/oauth/authorize' if options.sign_in?
+ end
+
+ def consumer
+ consumer = ::OAuth::Consumer.new(options.consumer_key, options.consumer_secret, {:site => 'http://api.t.sina.com.cn'}.merge(options.client_options))
+ consumer.http.open_timeout = options.open_timeout if options.open_timeout
+ consumer.http.read_timeout = options.read_timeout if options.read_timeout
+ consumer
end
uid { access_token.params[:id] }

0 comments on commit 5dfce73

Please sign in to comment.