diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/v1/users_controller.rb | 2 | ||||
-rw-r--r-- | app/models/account.rb | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/app/controllers/v1/users_controller.rb b/app/controllers/v1/users_controller.rb index d57db6f..2e840d9 100644 --- a/app/controllers/v1/users_controller.rb +++ b/app/controllers/v1/users_controller.rb @@ -30,7 +30,7 @@ module V1 end def destroy - @user.account.destroy + @user.account.destroy(params[:identities] == "destroy") if @user == current_user logout end diff --git a/app/models/account.rb b/app/models/account.rb index 67fec58..d13c929 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -47,9 +47,13 @@ class Account @user.refresh_identity end - def destroy + def destroy(destroy_identity=false) return unless @user - Identity.disable_all_for(@user) + if destroy_identity == false + Identity.disable_all_for(@user) + else + Identity.destroy_all_for(@user) + end @user.destroy end |