// auth and identity
Via APIFrontegg email verification with pingutil
Frontegg's USER_SIGNUP prehook fires on local, social and SSO sign-ups and waits for your verdict, which makes it the place to stop throwaway accounts before they reach a tenant. Your API prehook asks pingutil and answers allow or block; the block message appears on the failed sign-up prompt.
Where it connects: Frontegg API prehooks, USER_SIGNUP event
What goes wrong without it
- Temp-mail sign-ups create empty tenants in our Frontegg account and clutter the admin portal.
- We want free-trial abuse stopped before a tenant exists, not cleaned up after it.
- Our prehook has to answer inside Frontegg's timeout, so it cannot wait on a slow check.
What you can do with Frontegg and pingutil
Block disposable sign-ups before a tenant is created
Return verdict block with a 400 error when pingutil's verdict.is_spam is true. Frontegg stops the sign-up and shows your message.
Hold personal addresses out of team plans
For category free or isp, block with a "use your work email" message on plans where a company tenant is required.
Choose fail open
Set the prehook to fail open in Frontegg so a pingutil or network problem never blocks real users; the code also allows on its own errors.
Set it up
- 1
Deploy the endpoint below and set PINGUTIL_KEY and FRONTEGG_PREHOOK_SECRET in its environment.
- 2
In the Frontegg portal, create an API prehook for the USER_SIGNUP event pointing to your endpoint, and copy its secret.
- 3
Keep the timeout at the 5-second default or lower, and choose fail open.
- 4
Use the prehook's Run test button to see the exact payload, and confirm the email path the code reads.
- 5
Enable the prehook and sign up with a disposable address.
import express from 'express';
import jwt from 'jsonwebtoken';
const app = express();
app.use(express.json());
const allow = { continue: true, verdict: 'allow', response: {} };
const block = (message: string) => ({
continue: false,
verdict: 'block',
error: { status: 400, message: [message] },
});
app.post('/frontegg/prehooks/signup', async (req, res) => {
try {
// Frontegg signs the request in the x-webhook-secret header.
jwt.verify(String(req.get('x-webhook-secret')), process.env.FRONTEGG_PREHOOK_SECRET!, { algorithms: ['HS256'] });
} catch {
return res.status(401).end();
}
// Frontegg's sign-up examples read the address at data.user.email;
// confirm with Run test in the portal.
const email: string | undefined = req.body?.data?.user?.email;
if (!email) return res.json(allow);
try {
const r = 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 (!r.ok) return res.json(allow);
const data = await r.json();
if (data.verdict.is_spam) return res.json(block('Please sign up with a permanent email address.'));
return res.json(allow);
} catch {
return res.json(allow);
}
});
app.listen(3000);What to do with each result
| pingutil result | Action in Frontegg |
|---|---|
| verdict.is_spam: true | verdict "block", error.status 400, message shown on the sign-up prompt |
| category: "free" or "isp" (team-only plans) | verdict "block" with a work-email message |
| category: "company" | verdict "allow" |
| Timeout, 429 or 5xx | verdict "allow" (fail open), plus fail open in the prehook settings |
Limits to plan for
- Frontegg prehooks time out after 5 seconds by default, and the fail open or fail close setting decides what happens then. Fast mode fits; a full mailbox check may not.
- The API prehook docs do not publish the USER_SIGNUP payload. The data.user.email path comes from Frontegg's custom-code sign-up example; check it with Run test.
- USER_SIGNUP also fires for SSO and social sign-ups. Those addresses are usually corporate or provider-verified, so blocks there are rare but possible.
Frontegg documentation
- developers.frontegg.com/ciam/guides/integrations/prehooks
- developers.frontegg.com/ciam/guides/integrations/api-prehooks
- developers.frontegg.com/ciam/guides/integrations/custom-code
Frontegg is a trademark of its owner. This integration uses Frontegg's documented extension points; it is not an official Frontegg app.
Common questions
- Should I use an API prehook or a custom code prehook?
- An API prehook runs on your server, so you control the pingutil key, timeout and logging. Custom code prehooks run on Frontegg's side; their docs show the sign-up logic but not how outbound calls are handled, so we use the API version.
- Is the continue field still needed?
- Frontegg marks continue as deprecated in favor of verdict. The snippet sends both so it works with either reading of the response.
Stop bad addresses in Frontegg 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 Frontegg setup will receive.