Retry-Safe Server-Owned Firebase Account Deletion WorkflowRetry-Safe Server-Owned Firebase Account Deletion Workflow
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
Firebase account deletion fails in two ways, and only one of them is visible. The documented one is requires-recent-login, thrown when the sign-in behind the delete call is too old. The quieter one is the order of operations: the app deletes the Auth user first, the cleanup that runs afterwards fails halfway, and no signed-in user is left to retry from. The data stays in your database with no account attached. Make deletion a server-owned job. The app reauthenticates with a provider the account actually has, then calls one callable function. That function checks token freshness itself, because the Admin SDK can delete any user without a recent sign-in, and records the request in a transaction so a second tap returns the current status instead of starting another job. Then delete application data first and the Auth user last. Every step has to tolerate a rerun. While the identity exists, a failed job is one the user can sign in and retry. Once it is gone, nothing can.

duskolicanin.com

Build a Recoverable Firebase Account Deletion Flow

Fix Firebase account deletion that fails with requires-recent-login or leaves orphaned data: reauthenticate, then let a server job delete data before the user.

Sagar's avatar
Super insightful Dusko! 🔥 The "LOGIN DELETED. DATA LEFT BEHIND." visual hits hard.
That quieter failure mode with order of operations is something so many devs miss - deleting Auth user first before cleanup is a classic trap. Thanks for breaking this down, definitely checking your blog!
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started