Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript firebase kicks out current user

// Have a second app using the same creds to create the user
// This eliminates the fact that firebase signs out the current user
// when a new one is created.
var config = {apiKey: "apiKey",
    authDomain: "projectId.firebaseapp.com",
    databaseURL: "https://databaseName.firebaseio.com"};
var secondaryApp = firebase.initializeApp(config, "Secondary");

secondaryApp.auth().createUserWithEmailAndPassword(em, pwd).then(function(firebaseUser) {
    console.log("User " + firebaseUser.uid + " created successfully!");
    //I don't know if the next statement is necessary 
    secondaryApp.auth().signOut();
});
 
PREVIOUS NEXT
Tagged: #javascript #firebase #kicks #current #user
ADD COMMENT
Topic
Name
7+4 =