lib/omniauth/strategies/github.rb in oa-oauth-0.1.6 vs lib/omniauth/strategies/github.rb in oa-oauth-0.2.0.beta1
- old
+ new
@@ -6,16 +6,19 @@
# OAuth 2.0 based authentication with GitHub. In order to
# sign up for an application, you need to [register an application](http://github.com/account/applications/new)
# and provide the proper credentials to this middleware.
class GitHub < OAuth2
# @param [Rack Application] app standard middleware application argument
- # @param [String] app_id the application ID for your client
- # @param [String] app_secret the application secret
- def initialize(app, app_id, app_secret, options = {})
- options[:site] = 'https://github.com/'
- options[:authorize_path] = '/login/oauth/authorize'
- options[:access_token_path] = '/login/oauth/access_token'
- super(app, :github, app_id, app_secret, options)
+ # @param [String] client_id the application ID for your client
+ # @param [String] client_secret the application secret
+ def initialize(app, client_id = nil, client_secret = nil, options = {}, &block)
+ client_options = {
+ :site => 'https://github.com/',
+ :authorize_path => '/login/oauth/authorize',
+ :access_token_path => '/login/oauth/access_token'
+ }
+
+ super(app, :github, client_id, client_secret, client_options, options, &block)
end
protected
def user_data