Skip to content

// auth and identity

Via API

MojoAuth email verification with pingutil

Passwordless sign-in proves someone can read an inbox, and a temp-mail inbox can be read too. MojoAuth's docs describe webhooks such as user.created that fire after the fact, but no hook that can block a sign-up, so the check belongs in your own backend: after the OIDC code exchange, call pingutil before you create the local user.

Where it connects: MojoAuth hosted login (OIDC) callback in your backend, plus the user.created webhook

What goes wrong without it

  • Magic links and OTPs make sign-up easy, including for people cycling through throwaway inboxes for another free trial.
  • There is no place in the MojoAuth dashboard to say "reject this domain", so junk accounts appear in our database first.
  • We only find out an address was a typo when our own onboarding emails start bouncing.

What you can do with MojoAuth and pingutil

  • Gate local account creation in the callback

    After client.callback and client.userinfo, look up the email. If verdict.is_spam is true, show a "use a permanent address" page and do not create the user row.

  • Mark low-trust users for limited trials

    Store verdict.low_trust and the reason on the new user record so your app can hold back credits or features until the account looks real.

  • Review with the user.created webhook

    Subscribe to user.created and run /v1/verify on data.user.email in the background. It catches dead mailboxes that fast mode cannot see, without slowing the login redirect.

Set it up

  1. 1

    Set up MojoAuth hosted login as an OIDC application and follow their Node.js (Express) guide for the callback route.

  2. 2

    Create a pingutil API key and add it as PINGUTIL_KEY next to your MOJOAUTH_* variables.

  3. 3

    In the callback, look up the address only for emails that have no local user yet, as in the code below.

  4. 4

    Optionally add a webhook endpoint under Integration > Webhooks in the MojoAuth dashboard, subscribed to user.created, for background mailbox checks.

  5. 5

    Test with a disposable address and confirm no local user is written.

OIDC callback (Express + openid-client)
// Callback route from MojoAuth's Express guide, with a pingutil check
// before the first local user record is created.
async function screen(email) {
  try {
    const res = await fetch('https://pingutil.com/v1/lookup', {
      method: 'POST',
      headers: {
        authorization: 'Bearer ' + process.env.PINGUTIL_KEY,
        'content-type': 'application/json',
      },
      body: JSON.stringify({ input: email, skip_enrichment: true }),
      signal: AbortSignal.timeout(2000),
    });
    if (!res.ok) return { block: false };
    const data = await res.json();
    return { block: data.verdict.is_spam, lowTrust: data.verdict.low_trust, reason: data.verdict.reason };
  } catch {
    return { block: false }; // fail open
  }
}

app.get('/callback', async (req, res, next) => {
  try {
    const params = client.callbackParams(req);
    const tokenSet = await client.callback(process.env.MOJOAUTH_REDIRECT_URI, params, {
      code_verifier: req.session.code_verifier,
      state: req.session.state,
    });
    const userinfo = await client.userinfo(tokenSet.access_token);
    const email = String(userinfo.email || '').toLowerCase();

    let user = await db.users.findByEmail(email); // your data layer
    if (!user) {
      const check = await screen(email);
      if (check.block) return res.status(403).render('use-permanent-email');
      user = await db.users.create({
        email,
        mojoauthSub: userinfo.sub,
        lowTrust: Boolean(check.lowTrust),
        lowTrustReason: check.reason || null,
      });
    }

    req.session.user = userinfo;
    res.redirect('/');
  } catch (err) {
    next(err);
  }
});

What to do with each result

pingutil resultAction in MojoAuth
verdict.is_spam: trueDo not create the local user; render a "use a permanent address" page
verdict.low_trust: trueCreate the user with a lowTrust flag and reason
category: "company"Create the user; optionally run a full lookup later for company data
Webhook /v1/verify status: "invalid"Suspend the local user and stop onboarding emails to it
Timeout, 429 or 5xxCreate the user as normal (fail open)

Limits to plan for

  • MojoAuth's webhook docs describe notifications after the event and recommend answering within 3 seconds and processing asynchronously. They do not describe a hook that can deny a sign-up, so blocking happens in your backend, not in MojoAuth.
  • The MojoAuth account itself still exists after you refuse to create the local user. Your app simply never gives it access.
  • Fast mode catches disposable and randomized addresses, not dead mailboxes. Use /v1/verify from the webhook handler for mailbox status.

MojoAuth documentation

MojoAuth is a trademark of its owner. This integration uses MojoAuth's documented extension points; it is not an official MojoAuth app.

Common questions

Does MojoAuth have a pre-registration hook?
Not that its public docs describe. Its webhooks, including user.created, are notifications sent after the event. Put the blocking check in your OIDC callback before you create your own user record.
Will this slow down every login?
Only first logins. The code checks the address only when no local user exists yet, and fast-mode lookups return in milliseconds.

Stop bad addresses in MojoAuth today

Sign in with your email, create an API key and paste it into the step above. Test on a few real addresses first: the live demo shows exactly what your MojoAuth setup will receive.