From 5c160094fdaf4b69b53bf9dec3e62980ab1f6c8f Mon Sep 17 00:00:00 2001 From: Quentin Champenois <26109239+Quentinchampenois@users.noreply.github.com> Date: Tue, 14 Nov 2023 15:11:15 +0100 Subject: [PATCH] fix: Disable user confirmations when confirmation code (#35) * fix: Disable user confirmations when confirmation code * lint: Fix rubocop offenses --- .../decidim/friendly_signup/registrations_redirect.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/controllers/concerns/decidim/friendly_signup/registrations_redirect.rb b/app/controllers/concerns/decidim/friendly_signup/registrations_redirect.rb index 6344f38..a942115 100644 --- a/app/controllers/concerns/decidim/friendly_signup/registrations_redirect.rb +++ b/app/controllers/concerns/decidim/friendly_signup/registrations_redirect.rb @@ -8,6 +8,15 @@ module RegistrationsRedirect extend ActiveSupport::Concern included do + def show + if Decidim::FriendlySignup.use_confirmation_codes.present? + respond_with_navigational(resource) { redirect_to decidim.new_user_confirmation_path } + return + end + + super + end + def after_sign_up_path_for(user) codes_confirmation_path(user) || super(user) end