LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code

  
Alert: Missing Firebase Config.. kindly change firebase config below line:6
Register
Login
CSS
.margin-0 {
  margin: 0 !important;
}
.padding-0 {
  padding: 0 !important;
}
.center-block {
  width: 100% ;
}

#authCard .card .card-content {
  overflow: hidden;
}
#authCard .tabs .tab a {
  color: #eee;
}
#authCard .tabs .tab a.active {
  color: #00c853;
}
#authCard .tabs .indicator {
  background-color: #00c853;
  background: none;
}
#registerSection, #loginSection {
  overflow: hidden;
}
button[type="submit"].btn-large.green.accent-4 {
  margin-top: 30px;
}
JS
// Initialize Firebase
// TODO: Missing Firebase Config
firebase.initializeApp(config);
this.firebaseToken = document.querySelector("#firebase-token");
this.firebaseToken.innerHTML = "Welcome !";


// User SignUp
function authRegister(event) {
  event.preventDefault();
  var registerForm = $("form[name='registerForm']");
  var reg_email = registerForm.find('#register_email').val();
  var reg_password = registerForm.find('#register_password').val();

  firebase
    .auth()
    .createUserWithEmailAndPassword(reg_email, reg_password)
    .then(function () {
      this.firebaseToken.innerHTML = "Registered successfully !";
    })
    .catch(function(err) {
      alert(err.message);
    })
}


// User SignIn
function authLogin(event) {
  event.preventDefault();
  var loginForm = $("form[name='loginForm']");
  var log_email = loginForm.find('#login_email').val();
  var log_password = loginForm.find('#login_password').val();

  firebase
    .auth()
    .signInWithEmailAndPassword(log_email, log_password)
    .then(function () {
      this.firebaseToken.innerHTML = "Sign-in Successful !";
      console.log('sign in successful !');
      // outputFirebaseData();
    })
    .catch(function(err) {
      alert(err.message);
    });
}

function outputFirebaseData() {
  this.firebaseToken.innerHTML = "Hello world";
}
Host Instantly Drag and Drop Website Builder

 

Term
Wed, 11/29/2017 - 11:26

Related Codes

Pen ID
Pen ID
Pen ID