[Vuejs]-How do I perform an onAuthStateChanged in Vue Native?

0👍

Maybe we should move the code in mounted to a method.

<script>
mounted(){
this.checkAuth()
},
...
methods:{
async checkAuth(){
await firebase.auth().onAuthStateChanged(function (user) {
          if(user){
this.navigation.navigate("Auth")
}else{

this.navigation.navigate("App")
}
        });
}

}
</script>

Leave a comment