diff --git a/app/controllers/auth/registrations_controller.rb b/app/controllers/auth/registrations_controller.rb index 898d204d2d9..6390773b4b7 100644 --- a/app/controllers/auth/registrations_controller.rb +++ b/app/controllers/auth/registrations_controller.rb @@ -130,7 +130,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController end def require_rules_acceptance! - return if @rules.empty? || (session[:accept_token].present? && params[:accept] == session[:accept_token]) + return if @rules.empty? || validated_accept_token? @accept_token = session[:accept_token] = SecureRandom.hex @invite_code = invite_code @@ -139,6 +139,10 @@ class Auth::RegistrationsController < Devise::RegistrationsController render :rules end + def validated_accept_token? + session[:accept_token].present? && params[:accept] == session[:accept_token] + end + def is_flashing_format? # rubocop:disable Naming/PredicatePrefix if params[:action] == 'create' false # Disable flash messages for sign-up