app/controllers/sessions_controller.rb
# Google setup phase hook, that is used to dynamically set up a omniauth strategy for google on customer basis
Google setup phase hook, that is used to dynamically set up a omniauth strategy for google on customer basis
Google setup phase hook that is used to dynamically set up a omniauth strategy for google on customer basis
def google_setup
    request.env["omniauth.strategy"].options[:client_id] = @current_community.google_connect_id || APP_CONFIG.google_client_id
    request.env["omniauth.strategy"].options[:client_secret] = @current_community.google_connect_secret || APP_CONFIG.google_client_secret
    request.env["omniauth.strategy"].options[:iframe] = true
    request.env["omniauth.strategy"].options[:scope] = "public_profile,email"
    request.env["omniauth.strategy"].options[:info_fields] = "name,email,last_name,first_name"
    if @current_community.facebook_connect_enabled?
      request.env["omniauth.strategy"].options[:client_id] = @current_community.facebook_connect_id || APP_CONFIG.fb_connect_id
      request.env["omniauth.strategy"].options[:client_secret] = @current_community.facebook_connect_secret || APP_CONFIG.fb_connect_secret
    end
    render :plain => "Setup complete.", :status => 404 
  end
def google_setup request . env [ "omniauth.strategy" ] . options [ :client_id ] = @current_community . google_connect_id || APP_CONFIG . google_client_id request . env [ "omniauth.strategy" ] . options [ :client_secret ] = @current_community . google_connect_secret || APP_CONFIG . google_client_secret request . env [ "omniauth.strategy" ] . options [ :iframe ] = true request . env [ "omniauth.strategy" ] . options [ :scope ] = "public_profile,email" request . env [ "omniauth.strategy" ] . options [ :info_fields ] = "name,email,last_name,first_name" if @current_community . facebook_connect_enabled? request . env [ "omniauth.strategy" ] . options [ :client_id ] = @current_community . facebook_connect_id || APP_CONFIG . fb_connect_id request . env [ "omniauth.strategy" ] . options [ :client_secret ] = @current_community . facebook_connect_secret || APP_CONFIG . fb_connect_secret end render :plain => "Setup complete." , :status => 404 end
Google setup phase hook, that is used to dynamically set up a omniauth strategy for google on customer basis
Google setup phase hook that is used to dynamically set up a omniauth strategy for google on customer basis
# else #   # to prevent plain requests to /people/auth/facebook even when "login with Facebook" button is hidden #   request.env["omniauth.strategy"].options[:client_id] = "" #   request.env["omniauth.strategy"].options[:client_secret] = "" #   request.env["omniauth.strategy"].options[:client_options][:authorize_url] = login_url #   request.env["omniauth.strategy"].options[:client_options][:site_url] = login_url #This notifies the ominauth to continue