Sha256: c61b9cd651e479d13656ce677287a112b1d675492c443c8749b0d2cd04d4b01d
Contents?: true
Size: 1.17 KB
Versions: 7
Compression:
Stored size: 1.17 KB
Contents
# frozen_string_literal: true module Decidim module Devise # Custom Devise ConfirmationsController to avoid namespace problems. class ConfirmationsController < ::Devise::ConfirmationsController include Decidim::DeviseControllers helper_method :new_user_group_session_path # 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 `confirmation_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 # Overwrites the default method to handle user groups confirmations. def after_confirmation_path_for(resource_name, resource) return profile_path(resource.nickname) if resource_name == :user_group super end end end end
Version data entries
7 entries across 7 versions & 1 rubygems