summaryrefslogtreecommitdiff
path: root/app/controllers/registrations_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/registrations_controller.rb')
-rw-r--r--app/controllers/registrations_controller.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index fe800de5dd8..450c12a233b 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -5,6 +5,7 @@ class RegistrationsController < Devise::RegistrationsController
include AcceptsPendingInvitations
include RecaptchaHelper
include InvisibleCaptchaOnSignup
+ include OneTrustCSP
layout 'devise'
@@ -45,6 +46,11 @@ class RegistrationsController < Devise::RegistrationsController
end
def destroy
+ if current_user.required_terms_not_accepted?
+ redirect_to profile_account_path, status: :see_other, alert: s_('Profiles|You must accept the Terms of Service in order to perform this action.')
+ return
+ end
+
if destroy_confirmation_valid?
current_user.delete_async(deleted_by: current_user)
session.try(:destroy)