Sha256: d529149f55a51ab5f39505f03edee55cd769d05b5d48664391ad936761d5d3d6

Contents?: true

Size: 783 Bytes

Versions: 1

Compression:

Stored size: 783 Bytes

Contents

# frozen_string_literal: true

module Archangel
  ##
  # @see Archangel::AuthController
  #
  module Auth
    ##
    # Authentication registrations controller
    #
    class RegistrationsController < Devise::RegistrationsController
      before_action :allow_registration,
                    only: %i[cancel create destroy edit new update]

      protected

      def after_sign_up_path_for(resource)
        stored_location_for(resource) || root_path
      end

      def after_inactive_sign_up_path_for(resource)
        after_sign_up_path_for(resource)
      end

      def sign_up_params
        super.merge(site_id: current_site.id)
      end

      def allow_registration
        return render_404_error unless Archangel.config.allow_registration
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
archangel-0.3.0 app/controllers/archangel/auth/registrations_controller.rb