Sha256: d72d337d3b1026d56455edf86f093a0478930809bf47497f0b8fe26f4e9ea3ef

Contents?: true

Size: 909 Bytes

Versions: 49

Compression:

Stored size: 909 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Devise
    # Custom Devise UnlocksController to avoid namespace problems.
    class UnlocksController < ::Devise::UnlocksController
      include Decidim::DeviseControllers

      private

      # Since we're using a single Devise installation for multiple
      # organizations, and user emails can be repeated across organizations,
      # we need to identify the user by both the email and the organization.
      # Setting the organization ID here will be used by Devise internally to
      # find the correct user.
      #
      # Note that in order for this to work we need to define the `reset_password_keys`
      # Devise attribute in the `Decidim::User` model to include the
      # `decidim_organization_id` attribute.
      def resource_params
        super.merge(decidim_organization_id: current_organization.id)
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
decidim-core-0.27.9 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.27.8 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.27.7 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.27.6 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.26.10 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.26.9 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.27.5 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.26.8 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.27.4 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.27.3 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.26.7 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.26.5 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.27.2 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.27.1 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.26.4 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.27.0 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.26.3 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.27.0.rc2 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.27.0.rc1 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.26.2 app/controllers/decidim/devise/unlocks_controller.rb