Sha256: fbb22e5fc1d83895ba3cf66ce297abaa94003839680a607021606c4a08e582b6

Contents?: true

Size: 538 Bytes

Versions: 2

Compression:

Stored size: 538 Bytes

Contents

module Spree
  module Admin
    class AuthenticationMethodsController < ResourceController
      create.after :update_oauth_method
      update.after :update_oauth_method

      private

      def update_oauth_method
        auth_method = params[:authentication_method]
        return unless auth_method[:active] == 'true' && auth_method[:environment] == ::Rails.env
        Devise.setup do |config|
          config.omniauth auth_method[:provider], auth_method[:api_key], auth_method[:api_secret]
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solidus_social-1.1.0 app/controllers/spree/admin/authentication_methods_controller.rb
solidus_social-1.0.0 app/controllers/spree/admin/authentication_methods_controller.rb