HunchoDevelo HunchoDevelo - 1 year ago 67
Javascript Question

Firebase function is letting Invalid 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));

is a function that gets the error code and changes it into a customized message

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download