verify captcha only when captcha keys present

This commit is contained in:
rgarcia
2015-08-04 12:54:24 +02:00
parent 34fb646db3
commit 823426bfde
3 changed files with 11 additions and 10 deletions

View File

@@ -7,4 +7,9 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
def verify_captcha?(resource)
return true unless recaptcha_keys?
verify_recaptcha(model: resource)
end
end