2012-04-18 11:26:59 +00:00
|
|
|
module OmniAuth
|
|
|
|
module Strategies
|
|
|
|
|
|
|
|
class GoogleOauth2Database < OmniAuth::Strategies::GoogleOauth2
|
|
|
|
option :name, 'google_oauth2'
|
|
|
|
|
|
|
|
def initialize(app, *args, &block)
|
|
|
|
|
|
|
|
# database lookup
|
2012-05-06 20:46:13 +00:00
|
|
|
# puts 'GoogleOauth2Database -> initialize'
|
2012-04-18 11:26:59 +00:00
|
|
|
config = Setting.get('auth_google_oauth2_credentials') || {}
|
|
|
|
args[0] = config['client_id']
|
|
|
|
args[1] = config['client_secret']
|
|
|
|
super
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|