I am following the firebase documentation on user management
var firebase = require(\'firebase\');
// Initialize Firebase
firebase.initializeApp({
servi
I am not sure this is correct, but it helps:
and Config:
var config = {
apiKey: "xxxxxxxxxxxxxxx",
authDomain: "project-nnnnnnnnnnn.firebaseapp.com",
databaseURL: "https://project-nnnnnnnnnnn.firebaseio.com",
storageBucket: "project-nnnnnnnnnnn.appspot.com",
};
to local project fb/firebase.js
var firebase = require('./fb/firebase');
// Initialize Firebase
var config = {
apiKey: "xxxxxxxxxxxxxxx",
authDomain: "project-nnnnnnnnnnn.firebaseapp.com",
databaseURL: "https://project-nnnnnnnnnnn.firebaseio.com",
storageBucket: "project-nnnnnnnnnnn.appspot.com",
};
firebase.initializeApp(config);
export function createUser (email : string, password:string){
firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {
if (error.code){
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
alert(errorMessage);
console.log(errorMessage);
}
else{
// ...
}
});
}