1
0
Fork 0

Fix Recaptcha

This commit is contained in:
Alex Kotov 2020-02-15 04:57:12 +05:00
parent ebbc38cff9
commit 3f9b3de255
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
3 changed files with 6 additions and 2 deletions

View file

@ -36,6 +36,10 @@ private
request.format.json?
end
def verify_captcha(options = {})
verify_recaptcha options.reverse_merge timeout: 10
end
def render_not_found
respond_to do |format|
format.html { render status: :not_found, template: 'errors/not_found' }

View file

@ -71,7 +71,7 @@ protected
end
def check_captcha
return if verify_recaptcha
return if verify_captcha
self.resource = resource_class.new sign_up_params
resource.validate

View file

@ -28,7 +28,7 @@ class Users::SessionsController < Devise::SessionsController
protected
def check_captcha
return if verify_recaptcha
return if verify_captcha
self.resource = resource_class.new sign_in_params
render :new