Skip to content

Commit

Permalink
Merge pull request omniauth#452 from soorajb/master
Browse files Browse the repository at this point in the history
Most Google Oauth2 API not working - Google Email scope fix
  • Loading branch information
sferik committed Sep 2, 2011
2 parents 2a3e8ba + 6be3bf0 commit d5b1bb6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion oa-oauth/lib/omniauth/strategies/google_oauth2.rb
Expand Up @@ -20,7 +20,9 @@ def initialize(app, client_id = nil, client_secret = nil, options = {}, &block)
end

def request_phase
options[:scope] ||= "https://www.googleapis.com/auth/userinfo.email"
google_email_scope = "www.googleapis.com/auth/userinfo.email"
options[:scope] ||= "https://#{google_email_scope}"
options[:scope] << "https://#{google_email_scope}" unless options[:scope] =~ %r[http[s]?:\/\/#{google_email_scope}]
redirect client.auth_code.authorize_url(
{:redirect_uri => callback_url, :response_type => "code"}.merge(options))
end
Expand Down

0 comments on commit d5b1bb6

Please sign in to comment.