mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 09:06:21 +00:00
21 lines
576 B
Ruby
21 lines
576 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
# Modificaciones locales al registro de usuaries
|
||
|
#
|
||
|
# @see {https://github.com/heartcombo/devise/wiki/How-To:-Use-Recaptcha-with-Devise}
|
||
|
class RegistrationsController < Devise::RegistrationsController
|
||
|
class SpambotError < StandardError; end
|
||
|
|
||
|
prepend_before_action :anti_spambot_traps, only: %i[create]
|
||
|
|
||
|
private
|
||
|
|
||
|
# Detecta spambots simples
|
||
|
def anti_spambot_traps
|
||
|
raise SpambotError if params.dig(:usuarie, :name).blank?
|
||
|
rescue SpambotError => e
|
||
|
ExceptionNotifier.notify_exception(e, data: { params: params })
|
||
|
nil
|
||
|
end
|
||
|
end
|