Permalink
Browse files

Twitter has been adopted. See https://github.com/arunagw/omniauth-twi…

  • Loading branch information...
1 parent beed6d6 commit 027be2e65077eaa123992d64cff0190f634394e8 Michael Bleigh committed Nov 5, 2011
Showing with 3 additions and 54 deletions.
  1. +1 −1 README.md
  2. +2 −2 lib/omniauth-contrib.rb
  3. +0 −45 lib/omniauth/strategies/twitter.rb
  4. +0 −6 lib/omniauth/strategies/vkontakte.rb
View
@@ -6,7 +6,7 @@ source parent convert them into a real boy (er, gem).
## Strategies Available
-* Twitter
+* VKontakte (by @ivanovv)
## Interested in Adopting a Strategy?
View
@@ -3,8 +3,8 @@
module OmniAuth
module Strategies
- autoload :Twitter, 'omniauth/strategies/twitter'
+ autoload :VKontakte, 'omniauth/strategies/vkontakte'
end
end
-OmniAuth.config.add_camelization 'github', 'GitHub'
+OmniAuth.config.add_camelization 'vkontakte', 'VKontakte'
@@ -1,45 +0,0 @@
-require 'omniauth-oauth'
-require 'multi_json'
-
-module OmniAuth
- module Strategies
- class Twitter < OmniAuth::Strategies::OAuth
- option :name, 'twitter'
- option :client_options, {:site => 'https://api.twitter.com'}
- option :sign_in, true
- option :force_sign_in, false
-
- 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?
- end
-
- uid { access_token.params[:user_id] }
-
- info do
- {
- :nickname => raw_info['screen_name'],
- :name => raw_info['name'],
- :location => raw_info['location'],
- :image => raw_info['profile_image_url'],
- :description => raw_info['description'],
- :urls => {
- 'Website' => raw_info['url'],
- 'Twitter' => 'http://twitter.com/' + raw_info['screen_name'],
- }
- }
- end
-
- extra do
- { :raw_info => raw_info }
- end
-
- def raw_info
- @raw_info ||= MultiJson.decode(access_token.get('/1/account/verify_credentials.json').body)
- rescue ::Errno::ETIMEDOUT
- raise ::Timeout::Error
- end
- end
- end
-end
@@ -10,10 +10,6 @@ class VKontakte < OmniAuth::Strategies::OAuth2
:token_url => 'https://api.vkontakte.ru/oauth/token'
}
- def request_phase
- super
- end
-
uid { access_token['user_id'] }
info do
@@ -54,5 +50,3 @@ def raw_info
end
end
end
-
-OmniAuth.config.add_camelization 'vkontakte', 'VKontakte'

0 comments on commit 027be2e

Please sign in to comment.