Sha256: 5bc8ed431f3078155be2729c644d745510ed42499cab9137e38c464e15ca79f1

Contents?: true

Size: 593 Bytes

Versions: 5

Compression:

Stored size: 593 Bytes

Contents

# frozen_string_literal: true

module SolidusSocial
  module Spree
    module UserRegistrationsControllerDecorator
      def self.prepended(base)
        base.class_eval do
          after_action :clear_omniauth, only: :create
        end
      end

      private

      def build_resource(*args)
        super
        @spree_user.apply_omniauth(session[:omniauth]) if session[:omniauth]
        @spree_user
      end

      def clear_omniauth
        session[:omniauth] = nil unless @spree_user.new_record?
      end

      ::Spree::UserRegistrationsController.prepend self
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_social-1.6.0 app/decorators/controllers/solidus_social/spree/user_registrations_controller_decorator.rb
solidus_social-1.5.0 app/decorators/controllers/solidus_social/spree/user_registrations_controller_decorator.rb
solidus_social-1.4.0 app/decorators/controllers/solidus_social/spree/user_registrations_controller_decorator.rb
solidus_social-1.3.1 app/decorators/controllers/solidus_social/spree/user_registrations_controller_decorator.rb
solidus_social-1.3.0 app/decorators/controllers/solidus_social/spree/user_registrations_controller_decorator.rb