Skip to content

Add method on Users class to delete a user. #1119

Closed

Description

@vlidholt

There should be a method for permanently deleting users on the Users class in the auth module. See discussion:

Discussed in #1096

Originally posted by Frank1016 July 7, 2023
Hi, because I don't have any clue on how to delete account through EmailAuthController API calls, I tried to delete an account line directly in the database table "serverpod_user_info". However, after doing so, I cannot create another account using the same email address, and the error is about some duplicated ID. Could anyone tell me how to completely delete a registered account through EmailAuthController()?

Activity

  1. added
    enhancement
    on Jul 11, 2023
  2. lukehutch commented on Jul 11, 2023

    @lukehutch
    Contributor

    This method should also delete the user's profile image, and (probably also) any files uploaded by the user. However, first the userId that uploaded a given file needs to be tracked: See #922.

  3. dkbast commented on Apr 10, 2024

    @dkbast
    Contributor

    I think there should also be the following functionality:

    1. a "soft-delete" which only disables the user account
    2. a "anonymise-instead-of-delete" (Sometimes we want to (and are allowed to) keep the users data but need to make sure that there is no personal information left - in these cases overwriting the user info but keeping the "row in the database" can be utilised.
    3. a "onDeleteUser" callback where we can register some logic which is triggered by this method. This makes it easier to clean up the database etc.
  4. SandPod commented on Dec 18, 2024

    @SandPod
    Contributor

    Closing as duplicate of: #791

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions