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 18:13:55 +0100
committerClaire <claire.github-309c@sitedethib.com>2022-01-23 18:24:01 +0100
commit61ef81c548a0140a80281d4004ac55873d8f74d6 (patch)
tree770c251059d139243b9cb557c762648e0af55037 /app/controllers/auth/registrations_controller.rb
parent4d0383d75ac606f8c9c2b8ecb0ea2dddf28213cb (diff)
parent0a120d86d28e3f2e20455f56c1656f5d5f2f4af6 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `spec/models/status_spec.rb`:
  Upstream added tests too close to glitch-soc-specific tests.
  Kept both tests.
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]