Delete and Re-authenticate a User

Discover how to delete and re-authenticate users in Firebase.

Re-authenticate users

Sometimes, we may need to reauthenticate our application users before they perform security-sensitive actions, such as deleting an account, changing their primary email, or changing their passwords. These actions fail with an error if the user performing them signed in a long time ago. When this happens, we need to reauthenticate the user by requesting new sign-in credentials from either the user or the sign-in provider.

The Firebase Authentication SDK provides the reauthenticateWithCredential function, which receives the new user credentials to handle such cases:

Get hands-on with 1200+ tech skills courses.