Permalink
Browse files

Fix for google email scope.

  • Loading branch information...
1 parent 2a3e8ba commit fa374ab629eb6ac948e30d3bfb5730428e1f7db8 @soorajb soorajb committed Sep 2, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 oa-oauth/lib/omniauth/strategies/google_oauth2.rb
@@ -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 = "https://www.googleapis.com/auth/userinfo.email"
+ options[:scope] ||= google_email_scope
+ options[:scope] << "#{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

0 comments on commit fa374ab

Please sign in to comment.