diff --git a/CHANGELOG.md b/CHANGELOG.md index f369656..950e43a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] changes +## [v1.7.2] - 2020-08-18 + +### New +- User registration now requires passing reCAPTCHA. This is to further prevent spam registrations. + ## [v1.7.1] - 2020-08-17 ### New @@ -226,7 +231,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Account overview with list of all accounts and balances for each -[Unreleased]: https://github.com/odinsride/olubalance/compare/v1.7.1...develop +[Unreleased]: https://github.com/odinsride/olubalance/compare/v1.7.2...develop +[v1.7.1]: https://github.com/odinsride/olubalance/compare/v1.7.1...v1.7.2 [v1.7.1]: https://github.com/odinsride/olubalance/compare/v1.7.0...v1.7.1 [v1.7.0]: https://github.com/odinsride/olubalance/compare/v1.6.4...v1.7.0 [v1.6.4]: https://github.com/odinsride/olubalance/compare/v1.6.3...v1.6.4 diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 63ccf19..21506b7 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -6,22 +6,11 @@ class RegistrationsController < Devise::RegistrationsController private def check_captcha - success = verify_recaptcha(action: 'registration', minimum_score: 0.5) - checkbox_success = verify_recaptcha unless success - if success || checkbox_success - - else - if !success - @show_checkbox_recaptcha = true - end - render 'new' + unless verify_recaptcha + self.resource = resource_class.new sign_up_params + resource.validate # Look for any other validation errors besides reCAPTCHA + set_minimum_password_length + respond_with_navigational(resource) { render :new } end - - # unless verify_recaptcha - # self.resource = resource_class.new sign_up_params - # resource.validate # Look for any other validation errors besides reCAPTCHA - # set_minimum_password_length - # respond_with_navigational(resource) { render :new } - # end end end diff --git a/app/views/devise/registrations/components/_formNew.html.erb b/app/views/devise/registrations/components/_formNew.html.erb index 1a1414b..4536fca 100644 --- a/app/views/devise/registrations/components/_formNew.html.erb +++ b/app/views/devise/registrations/components/_formNew.html.erb @@ -115,12 +115,12 @@ - <%= flash[:recaptcha_error] %> - <% if @show_checkbox_recaptcha %> - <%= recaptcha_tags %> - <% else %> - <%= recaptcha_v3(action: 'registration') %> - <% end %> +
+
+ <%= flash[:recaptcha_error] %> + <%= recaptcha_tags %> +
+
diff --git a/config/application.rb b/config/application.rb index 6282b33..2d6977f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -23,7 +23,7 @@ class Application < Rails::Application config.load_defaults 6.0 # olubalance Version - config.version = "1.7.1" + config.version = "1.7.2" # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers