Having trouble removing an account from Firebase in vue.js. Followed the firebase docs but it's not working as expected. Here is the button to delete:
<template>
[...]
<div class="text-center">
<button type="button" class="btn text-white my-4" @click="$emit('deleteUser')">Delete account</button>
</div>
[...]
</template>
Below is the method being used:
<script>
[...]
import firebase from "firebase"
import {router} from '../main'
export default {
[...]
},
methods: {
[...]
deleteUser () {
//const userRef = firebase.auth().currentUser;
this.usersRef.remove().then(function() {
// User deleted.
console.log("User deleted")
router.push('/')
}).catch(err => {
this.error = err.message
// An error happened.
console.log("User NOT deleted")
});
}
};
</script>
Wondering if anyone can offer some assistance? The account is still present and cannot be removed, with zero information appearing in the console.