1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Fixed require_strategy for google_oauth2 omniauth strategy.

This commit is contained in:
Christian Buggle 2011-11-14 19:14:28 +01:00
parent a71319a080
commit 065963f6d3
3 changed files with 3 additions and 2 deletions

View file

@ -11,6 +11,7 @@ gem "rdoc"
group :test do
gem 'omniauth-facebook'
gem 'omniauth-openid', '~> 1.0.1'
gem "omniauth-google-oauth2", '~> 0.1.4'
gem "webrat", "0.7.2", :require => false
gem "mocha", :require => false
end

View file

@ -28,7 +28,7 @@ module Devise
end
def require_strategy
if [:facebook, :github, :twitter].include?(provider.to_sym)
if [:facebook, :github, :twitter, :google_oauth2].include?(provider.to_sym)
require "omniauth/strategies/#{provider}"
elsif options[:require]
require options[:require]

View file

@ -179,7 +179,7 @@ Devise.setup do |config|
config.omniauth :facebook, 'APP_ID', 'APP_SECRET', :scope => 'email,offline_access'
config.omniauth :openid
config.omniauth :openid, :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'
config.omniauth :google_oauth2, 'APP_ID', 'APP_SECRET', :scope => 'https://www.googleapis.com/auth/userinfo.email'
# ==> Warden configuration
# If you want to use other strategies, that are not supported by Devise, or
# change the failure app, you can configure them inside the config.warden block.