about summary refs log tree commit diff
path: root/app/controllers/auth/registrations_controller.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-01-23 19:17:31 +0100
committerGitHub <noreply@github.com>2022-01-23 19:17:31 +0100
commite58e0eb9aa375b1107b207e8229a2142c4edc0b8 (patch)
tree9418aede73dbd682e937f900cd0eb1b637f2ea24 /app/controllers/auth/registrations_controller.rb
parentb209e919bddb4bb72bb4f8589f4b15654f22ef53 (diff)
parent9483d0c6b2b3eaffca8e02e8be4b9a21c5f9e767 (diff)
Merge pull request #1663 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/controllers/auth/registrations_controller.rb')
-rw-r--r--app/controllers/auth/registrations_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/auth/registrations_controller.rb b/app/controllers/auth/registrations_controller.rb
index 87f24183e..6b1f3fa82 100644
--- a/app/controllers/auth/registrations_controller.rb
+++ b/app/controllers/auth/registrations_controller.rb
@@ -82,13 +82,17 @@ class Auth::RegistrationsController < Devise::RegistrationsController
   end
 
   def check_enabled_registrations
-    redirect_to root_path if single_user_mode? || !allowed_registrations?
+    redirect_to root_path if single_user_mode? || omniauth_only? || !allowed_registrations?
   end
 
   def allowed_registrations?
     Setting.registrations_mode != 'none' || @invite&.valid_for_use?
   end
 
+  def omniauth_only?
+    ENV['OMNIAUTH_ONLY'] == 'true'
+  end
+
   def invite_code
     if params[:user]
       params[:user][:invite_code]