Class: Kiqr::RegistrationsController

Inherits:
Devise::RegistrationsController
  • Object
show all
Defined in:
app/controllers/kiqr/registrations_controller.rb

Instance Method Summary collapse

Instance Method Details

#deleteObject

GET /settings/cancel



8
9
10
11
12
# File 'app/controllers/kiqr/registrations_controller.rb', line 8

def delete
  add_breadcrumb t("kiqr.breadcrumbs.settings.root"), 
  add_breadcrumb t("kiqr.breadcrumbs.settings.users.delete_user"), delete_user_registration_path
  @conflicting_members = current_user.members.where(owner: true)
end

#destroyObject

DELETE /users



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/kiqr/registrations_controller.rb', line 15

def destroy
  # Don't let user cancel their accounts if they are an owner of a team.
  if current_user.members.find_by(owner: true)
    kiqr_flash_message(:alert, :cant_cancel_while_team_owner)
    return redirect_to delete_user_registration_path
  end

  # TODO: Don't let user delete account if they have active subscriptions.
  # TODO: Verify otp before deleting account
  # TODO: Don't delete account immediately, but mark it as deleted and delete it after 30 days.
  # TODO: Send email to user with confirmation link to delete account.'

  super # Inherits from Devise::RegistrationsController
end