Retrospring/app/controllers/user/registrations_controller.rb

18 lines
615 B
Ruby
Raw Normal View History

class User::RegistrationsController < Devise::RegistrationsController
2020-05-22 13:29:22 -07:00
def create
2020-05-22 13:42:10 -07:00
if !APP_CONFIG.dig(:hcaptcha, :enabled) || verify_hcaptcha(model: resource)
2020-05-22 13:29:22 -07:00
super
else
respond_with_navigational(resource){ redirect_to new_user_registration_path }
end
end
def destroy
DeletionWorker.perform_async(resource.id)
Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name)
set_flash_message :notice, :destroyed if is_flashing_format?
yield resource if block_given?
respond_with_navigational(resource){ redirect_to after_sign_out_path_for(resource_name) }
end
end