about summary refs log tree commit diff
path: root/app/controllers/concerns
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-01-24 22:12:57 +0100
committerClaire <claire.github-309c@sitedethib.com>2022-01-24 22:12:57 +0100
commitbf351d72af76e80a29674770d9991de955f95d34 (patch)
tree14d30f2f450f62f1d265f638026167484b5d0037 /app/controllers/concerns
parent6a2f248fe4ed59f512dd318a006209fb7b71aa7e (diff)
Disable captcha if registrations are disabled for various reasons
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r--app/controllers/concerns/captcha_concern.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/concerns/captcha_concern.rb b/app/controllers/concerns/captcha_concern.rb
index 5bc4ba920..4a942c988 100644
--- a/app/controllers/concerns/captcha_concern.rb
+++ b/app/controllers/concerns/captcha_concern.rb
@@ -23,6 +23,8 @@ module CaptchaConcern
   end
 
   def captcha_required?
+    return false if ENV['OMNIAUTH_ONLY'] == 'true'
+    return false unless Setting.registrations_mode != 'none' || @invite&.valid_for_use?
     captcha_enabled? && !current_user && !(@invite.present? && @invite.valid_for_use? && !@invite.max_uses.nil?) && !captcha_recently_passed?
   end