Sha256: 920bbdbc11cf3aee1d66ddb48e794924b8e4b0d0647b47b1d5aba6baa654d9f9

Contents?: true

Size: 910 Bytes

Versions: 13

Compression:

Stored size: 910 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 are 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

13 entries across 13 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.28.4 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.29.0 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.28.3 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.29.0.rc4 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.29.0.rc3 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.29.0.rc2 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.29.0.rc1 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.28.2 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.28.1 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.28.0 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.28.0.rc5 app/controllers/decidim/devise/unlocks_controller.rb
decidim-core-0.28.0.rc4 app/controllers/decidim/devise/unlocks_controller.rb