Back

Functions - Delete User

  • 0
  • Tools
  • Cloud
LosDragon
3 Oct, 2024, 13:01

My app was rejected by apple because: "The app supports account creation but does not include an option to initiate account deletion. Apps that support account creation must also offer account deletion to give users more control of the data they've shared while using an app."

So now I have to add that ability. I have done some quick searching and I may have found a solution:

  • Create a function to delete all of the users data (documents)
  • If data deletion success - proceed with account deletion

https://appwrite.io/docs/references/cloud/server-nodejs/users#delete

Now heres where I find the problem. I do NOT want to give "Any" permissions to delete documents on any of my Collections in my DB. Is there a way I can authenticate as a user from within my function so that All collections only need permissions for "Users" vs "Any"?

Thanks

TL;DR
- Developer needs to add account deletion option due to rejection from Apple - Solution: Create a function to delete user data, then proceed with account deletion - Developer wants to authenticate as a user within the function to avoid giving "Any" permissions to delete documents from all Collections in the DB
Tomic R.
3 Oct, 2024, 13:18

Hey @LosDragon, yes there is a way: In your appwrite function, you can use JWT. This helps you act on behalf of the user in your function. Here is the documentation for that: https://appwrite.io/docs/products/functions/develop#using-jwt

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more