Omit hCaptcha if it is disabled

This commit is contained in:
Dominik M. Kwiatek 2020-05-22 21:42:10 +01:00
parent 7cac93ad4e
commit 984976a2f7
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,6 @@
class User::RegistrationsController < Devise::RegistrationsController
def create
if verify_hcaptcha(model: resource)
if !APP_CONFIG.dig(:hcaptcha, :enabled) || verify_hcaptcha(model: resource)
super
else
respond_with_navigational(resource){ redirect_to new_user_registration_path }

View File

@ -14,7 +14,8 @@
= f.password_field :password, autocomplete: :off, label: t('views.settings.account.password')
= f.password_field :password_confirmation, autocomplete: :off, label: t('views.settings.account.password_confirm')
= hcaptcha_tags
- if APP_CONFIG.dig(:hcaptcha, :enabled)
= hcaptcha_tags
%p= raw t('views.sessions.info', terms: link_to(t('views.general.terms'), terms_path))
= f.submit 'Sign up', class: 'btn btn-primary mb-3'