简体   繁体   English

删除 firebase 中的 auth 用户 react native

[英]Delete auth user in firebase react native

I am trying to delete auth user from firebase with email or uid.我正在尝试使用 email 或 uid 从 firebase 中删除身份验证用户。 I searched on google but I did not find any solution.我在谷歌上搜索,但没有找到任何解决方案。

There is a code section:有一段代码:

getAuth()
  .deleteUser(uid)
  .then(() => {
    console.log('Successfully deleted user');
  })
  .catch((error) => {
    console.log('Error deleting user:', error);
  });

Additionally reference link: https://firebase.google.com/docs/auth/admin/manage-users#delete_a_user另外参考链接: https://firebase.google.com/docs/auth/admin/manage-users#delete_a_user

I found this method, but this deletes current user, I want to delete the specific user.我找到了这个方法,但这会删除当前用户,我想删除特定用户。

import { getAuth, deleteUser } from "firebase/auth";

const auth = getAuth();
const user = auth.currentUser;

deleteUser(user).then(() => {
// User deleted.
}).catch((error) => {
// An error ocurred
// ...
});

For React Native对于 React Native

import auth from "@react-native-firebase/auth";

 let user = auth().currentUser;
    user
      .delete()
      .then(() => console.log("User deleted"))
      .catch((error) => console.log(error));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React Native Firebase Auth 用户是 null - React Native Firebase Auth user is null 删除 firebase auth with angular 中的一个用户 - Delete an user in firebase auth with angular Firebase 使用 React Native 进行电话身份验证 Expo - Firebase Phone Auth with React Native Expo 在 Firebase 中扩展“expirationTime” 在 React Native 中验证“stsTokenManager” - Extend "expirationTime" in Firebase Auth "stsTokenManager" in React Native React Native:尝试创建新用户时出现 firebase auth/network-request-failed 错误,但在登录时却没有? - React Native: firebase auth/network-request-failed error when trying to create a new user, but not on login? Getstream firebase auth react 本机文档? - Getstream firebase auth react native documentation? React Native 导入 firebase 'auth' 和 'firestore' - React Native import firebase 'auth' and 'firestore' React-Native-Firebase Spread auth().currentUser Object {...auth().currentUser} - React-Native-Firebase Spread auth().currentUser Object {...auth().currentUser} Firebase 身份验证对 React Native auth.tenandId 错误 - Firebase authentication on React Native auth.tenandId error 如何在 React Native 的 Firebase auth 中不使用 navigation.navigate(" ") - How not to use navigation.navigate(" ") in Firebase auth in React Native
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM