Merge branch 'main' into glitch-soc/merge-upstream
This commit is contained in:
		@@ -83,7 +83,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def check_enabled_registrations
 | 
			
		||||
    redirect_to root_path if single_user_mode? || omniauth_only? || !allowed_registrations?
 | 
			
		||||
    redirect_to root_path if single_user_mode? || omniauth_only? || !allowed_registrations? || ip_blocked?
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def allowed_registrations?
 | 
			
		||||
@@ -94,6 +94,10 @@ class Auth::RegistrationsController < Devise::RegistrationsController
 | 
			
		||||
    ENV['OMNIAUTH_ONLY'] == 'true'
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def ip_blocked?
 | 
			
		||||
    IpBlock.where(severity: :sign_up_block).where('ip >>= ?', request.remote_ip.to_s).exists?
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def invite_code
 | 
			
		||||
    if params[:user]
 | 
			
		||||
      params[:user][:invite_code]
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user