5.3.0
I implemented deleteUser()
(thanks #281!) but if the user's most recent login is more than 5 minutes ago, the operation is rejected by Firebase with the error auth/requires-recent-login
.
In this situation, the Firebase docs say to use reauthenticateWithCredential(), however, this function is unavailable.
I hope for a way to ask the user to re-authenticate in-place. Otherwise I think I'd have to log them out, which resets all app state, then get them to log back in, navigate back to the delete account page, and re-try within 5 minutes.
n/a
export async function deleteUser() {
try {
await FirebaseAuthentication.deleteUser()
} catch (err) {
//
// If 'err' is `auth/requires-recent-login`, Firebase docs say to try something like the below:
//
const auth = getFirebaseAuth() // my function for generating auth.currentUser
const credential = getCredential() // my function for generating credential
// THIS FAILS, because the function does not exist
await FirebaseAuthentication.reauthenticateWithCredential(auth.currentUser, credential)
await FirebaseAuthentication.deleteUser() // retry
}
}
### Other information
Error: "FirebaseAuthentication.reauthenticateWithCredential()" is not implemented on web
### Capacitor doctor
π Capacitor Doctor π
Latest Dependencies:
@capacitor/cli: 5.6.0
@capacitor/core: 5.6.0
@capacitor/android: 5.6.0
@capacitor/ios: 5.6.0
Installed Dependencies:
@capacitor/cli: 5.6.0
@capacitor/core: 5.6.0
@capacitor/ios: 5.6.0
@capacitor/android: 5.6.0
### Before submitting
- [X] I have read and followed the [bug report guidelines](https://capawesome.io/contributing/bug-reports/).
- [X] I have attached links to possibly related issues and discussions.
- [X] I understand that incomplete issues (e.g. without reproduction) are closed.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too