From 280fa3b2c01b9d6c5cfb2ed608087038b6c1a0ae Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 31 Mar 2023 21:42:28 +0200 Subject: [PATCH] Fix invalid/expired invites being processed on sign-up (#24337) --- app/controllers/auth/registrations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/auth/registrations_controller.rb b/app/controllers/auth/registrations_controller.rb index c5418ba0ce4..b55f7f309f9 100644 --- a/app/controllers/auth/registrations_controller.rb +++ b/app/controllers/auth/registrations_controller.rb @@ -46,7 +46,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController super(hash) resource.locale = I18n.locale - resource.invite_code = params[:invite_code] if resource.invite_code.blank? + resource.invite_code = @invite&.code if resource.invite_code.blank? resource.registration_form_time = session[:registration_form_time] resource.sign_up_ip = request.remote_ip