module OAuth2Me

Constants

VERSION

Public Class Methods

banned_environments() click to toggle source
# File lib/oauth2-me.rb, line 11
def banned_environments
  @@banned_environments = ['production']
end
check_setup!() click to toggle source
# File lib/oauth2-me.rb, line 28
def check_setup!
  environment = ENV['RAILS_ENV'] || ENV['RACK_ENV']
  raise BannedEnvironmentError.new if environment && banned_environments.include?(environment)
end
omniauth_strategy_updater() click to toggle source
# File lib/oauth2-me.rb, line 15
def omniauth_strategy_updater
  @@omniauth_strategy_updater ||= OAuth2Me::OmniauthStrategyUpdater.new
end
setup_devise!() click to toggle source
# File lib/oauth2-me.rb, line 19
def setup_devise!
  check_setup!
  Devise::OmniAuth::Config.send :define_method, :strategy_class_with_redirect do
    strategy_class = strategy_class_without_redirect
    OAuth2Me.omniauth_strategy_updater.setup_omniauth_strategy(strategy_class)
  end
  Devise::OmniAuth::Config.alias_method_chain :strategy_class, :redirect
end