首页 > 解决方案 > 注销用户时出错 - invertase React Native Firebase

问题描述

我正在尝试从我的应用程序中注销用户,但我从控制台收到此消息。

Possible Unhandled Promise Rejection (id: 1):
TypeError: undefined is not an object (evaluating '_auth.firebase.auth.currentUser.signOut')

以下文档(https://invertase.io/oss/react-native-firebase/v6/auth/reference/module#signOut)我做了一个这样的功能

async function LogoutUser() {
    firebase.auth.currentUser.signOut();
  }

但用户帐户没有任何反应。请问,谁能帮帮我?

标签: firebasereact-nativereact-native-firebase

解决方案


signOut是身份验证的功能。试试下面的代码

 firebase.auth().signOut().then(function(){
        console.log('Signed Out');
    },function(error){

    });

推荐阅读