Files
astuto/app/controllers/registrations_controller.rb

15 lines
566 B
Ruby
Raw Normal View History

class RegistrationsController < Devise::RegistrationsController
2022-07-18 10:47:54 +02:00
# Needed to have Current.tenant available in Devise's controllers
prepend_before_action :load_tenant_data
before_action :load_oauths, only: [:new]
2022-07-18 10:47:54 +02:00
# Override destroy to soft delete
def destroy
resource.status = "deleted"
resource.save
Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name)
set_flash_message :notice, :destroyed
yield resource if block_given?
respond_with_navigational(resource){ redirect_to after_sign_out_path_for(resource_name) }
end
end