Javascript 对象(…)()。带Email和Password的SigninUserWithPassword不是函数。。。。关于尝试登录用户
我正在尝试对react聊天应用程序的用户进行身份验证,所有其他功能(如注册、使用谷歌注册)都运行良好,但当我尝试使用现有帐户登录时,它会显示出来 对象…signInUserWithEmailAndPassword不是函数 我的身份验证文件代码如下Javascript 对象(…)()。带Email和Password的SigninUserWithPassword不是函数。。。。关于尝试登录用户,javascript,reactjs,firebase,firebase-authentication,Javascript,Reactjs,Firebase,Firebase Authentication,我正在尝试对react聊天应用程序的用户进行身份验证,所有其他功能(如注册、使用谷歌注册)都运行良好,但当我尝试使用现有帐户登录时,它会显示出来 对象…signInUserWithEmailAndPassword不是函数 我的身份验证文件代码如下 import {auth} from "./firebase"; export function signup(email,password){ return auth().createUserWithEmailAndP
import {auth} from "./firebase";
export function signup(email,password){
return auth().createUserWithEmailAndPassword(email,password);
}
export function signin(email,password){
return auth().signInUserWithEmailAndPassword(email,password)
}
export function signInWithGoogle(){
const provider= new auth.GoogleAuthProvider()
return auth().signInWithPopup(provider)
}
export function signInWithGithub(){
const provider= new auth.GithubAuthProvider()
return auth().signInWithPopup(provider)
}
export function logout(){
return auth().signOut();
}
我的firebase文件
请使用react js遵循firebase auth的以下步骤:
我认为没有像signInUserWithEmailAndPassword这样的函数,也有像signInWithEmailAndPassword这样的函数。请遵循firebase auth with react js的以下步骤:
我认为没有像signInUserWithEmailAndPassword这样的函数,有一个函数是signInWithEmailAndPassword。您正在寻找的方法是
您正在寻找的方法是
是的,所有其他功能都很好,我只是在login@Codewizard你的函数名改变了,只是随着我的改变而已。是的,所有其他的函数都工作得很好,我只在login@Codewizard你的函数名变了,我的函数名也变了
import firebase from 'firebase/app'
import 'firebase/auth'
import 'firebase/database'
const firebaseConfig = {
//Hide keys
};
firebase.initializeApp(firebaseConfig);
export default firebase;
export const auth = firebase.auth;
export const db = firebase.database();
export function signin(email,password){
return auth().signInWithEmailAndPassword(email,password)
}