1

I am making an authentication form and I would like to verify silently an email address is active on the client side. That is if the email address exists, then return true, else return false. This does not involve sending an actualy email to the address. I can do this on the server side using email-verify package in node, ie:

server.post('/api/verify-valid-email-silently', (req, res) => {

    if (req.body && req.body.email) {

        const email = req.body.email

        email_verifier.verify( email, (err : string, info : any) => {
            // do something
        })
    }
}

But I would like to do this on the client side so that I don't have to ping the server and pay for cloud function invocation. Again I'm looking for a free service on the client side. This is important because if I use the current "ping the server" way, someone could conceivably repeatedly enter inactive but well-formed email address and drain my bank account dry completely.

xiaolingxiao
  • 4,793
  • 5
  • 41
  • 88
  • 1
    Unless you are starting all the possible email addresses on the client, surely you will have to make a server request? – andy mccullough Jun 17 '18 at 16:52
  • 5
    You can't verify an email address client side...and actually not server side either, with 100% accuracy. For 100% verification a user action is needed. – Asons Jun 17 '18 at 16:54
  • I just want to verify an email account exist at the address. – xiaolingxiao Jun 17 '18 at 17:04
  • 1
    As I said, you just can't. – Asons Jun 17 '18 at 17:06
  • Yeah I have a another function that actually sends an email to the user to check he owns the email. This is more like a first line of defense and alerts the user if he accidentally enter the wrong email that is not malformed. User feedback is the normal use case but opens me up to an exploit. If I don’t check for valid email the account is created by Firebase anyways. which also results in a charge. So ideally inactive emails afe screened out on the client even if the process is not 100% accurate – xiaolingxiao Jun 17 '18 at 19:18
  • This answer of mine might be of interest, as it has a link on how to do _NSLookup_, which could be useful: https://stackoverflow.com/questions/49314277/how-should-i-verify-email-address-existence-and-domain-name-existence-in-javascr/49314577#49314577 – Asons Jun 20 '18 at 10:06

1 Answers1

1

It does require a validation email, but it can be done without maintaining server-side infrastructure. I actually built a platform to do exactly that at https://clicktoverify.net/.

Essentially you just need to add our (small) javascript library to your page. Then you'll be able to send a verification email via our service and execute a client-side callback once the client verifies by clicking the link in their email.

C. Tindall
  • 413
  • 3
  • 8