firebase.auth()を使用して認証を作成し、firebaseのマニュアルsignInWithUsernameAndPasswordから直接メソッドを呼び出そうとすると、動作しません。私は ウェブストームを使用しており、認識できない方法だと言われています。Firebase web。いいえsignInWithUsernameAndPassword関数
// Initialize Firebase
var config = {
apiKey: "AIzaSyBbmdeersid6XSA4kh_TYsGgVSgVF5BrFs",
authDomain: "eraticators-73723.firebaseapp.com",
databaseURL: "https://eraticators-73723.firebaseio.com",
projectId: "eraticators-73723",
storageBucket: "eraticators-73723.appspot.com",
messagingSenderId: "782651564720"
};
firebase.initializeApp(config);
const txtEmail = document.getElementById("user");
const txtPassword = document.getElementById("password");
const btnLogin = document.getElementById("btnLogin");
btnLogin.addEventListener("click", function() {
const email = txtEmail.value;
const pass = txtPassword.value;
const auth = firebase.auth();
firebase.auth().signInWithUsernameAndPassword(email, pass);
});
これは私のjavascriptファイルです。推奨される関数はsignInViaPopup()とsignInViaRedirect()のみです。なぜそれがまさにドキュメンテーションが使用すると言っているときsignInWithUsernameAndPassword関数はありませんか?
また、 'firebase console - > authentication - > sign-in method 'でEmail/Passwordオプションを有効にする必要があります。 – Hareesh