Class: Hancock::SessionsController
- Inherits:
-
Devise::SessionsController
- Object
- Devise::SessionsController
- Hancock::SessionsController
- Includes:
- Decorators::Sessions
- Defined in:
- app/controllers/hancock/sessions_controller.rb
Instance Method Summary collapse
-
#check_recaptcha ⇒ Object
private :check_recaptcha.
Instance Method Details
#check_recaptcha ⇒ Object
private :check_recaptcha
6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/hancock/sessions_controller.rb', line 6 def check_recaptcha if Hancock.config.recaptcha_support and (!Rails.env.development? or Hancock.config.captcha_on_development) unless verify_recaptcha self.resource = resource_class.new sign_in_params resource.errors.add(:email, "Неверный e-mail или пароль".freeze) resource.errors.add(:password, "Неверный e-mail или пароль".freeze) @recaptcha_error = "Вы робот?".freeze (resource) { render :new } end end end |