jgero / roesena-app

Cross platform Web-App with user-created content and event manager
https://rösena.de/
0 stars 1 forks source link

deleting user is very messy in the code #266

Closed jgero closed 3 years ago

jgero commented 3 years ago

There is a cloud function that triggers on user delete in the auth and deletes the corresponding person document. But there is also a cloud function to delete a user that deletes the auth entry and document.

Have a look at the code to see what is used and remove the unnecessary cloud function.

jgero commented 3 years ago

When an auth user is deleted a function is triggered, which deletes the corresponding firestore document. The rest endpoint is deleting the document and the auth entry. To avoid broken accounts the document should be deleted in the auth deletion hook, because then it is still possible to delete auth accounts from the firebase console safely.