Я пытаюсь создать коллекцию в firebase после аутентификации google, я создаю const с данными и работает правильно, но firestore не создает коллекцию
Когда я выполняю console.logк данным файл json показывает отлично.Я могу получить доступ ко всей информации.Также я дал права на запись в консоль Firebase
submitGoogle() {
const provider = new firebase.auth.GoogleAuthProvider();
firebase.auth().signInWithPopup(provider)
.then((result) => {
const data = {
uid: result.user.uid,
email: result.additionalUserInfo.profile.email,
name: result.additionalUserInfo.profile.name,
role: 'customer'
};
console.log(data)
db.collection('users').doc(result.user.uid).set(data).then(() =>
{
this.$store.commit('setRole', data.role);
this.$router.push('/');
});
})
.catch((error) => {
this.message = error.message.substr(0, 60);
this.snackBar = true;
setTimeout(() => {
this.snackBar = false;
}, this.timeout);
});
},