HunchoDevelo HunchoDevelo - 6 months ago 37
Javascript Question

Firebase function is letting unvalid emails to be allowed

I am new to firebase, sorry if this seems basic

I wrote a segment of code that should register a user. And it does just that, but, I can fill in an email that does not exist.

This is not the full code, just the function that is responsible for this

window.createUser = function (email, password) {
firebase.auth().createUserWithEmailAndPassword(email, password).then(function () {
}).catch(function (error) {
if (document.getElementById("lemail").value == "" && document.getElementById("lpassword").value == "") {
$("#lalert").html("<strong>Oh no! </strong> Looks like the email or password inputs are not filled out!");

} else {

$("#lalert").html("<strong>Oh no! </strong>" + aTranslate(error.code));

  • aTranslate() is a function that gets the error code and changes it into a customized message


If an email that doesn't exist is an email that is not real and made up, then Firebase authentication does not check to see whether or not an email is legit or a made up one. You would have to test whether it is a valid email or not by yourself.