On this page
What this issue is
Two-factor authentication (2FA) asks for a second proof of identity after the password. An OTP is a one-time passcode, sent by SMS or email, or generated by an authenticator app (TOTP). Many SaaS products also use OTP at signup to verify a phone number or email.
An automated test cannot read your phone or inbox by default. It reaches the code prompt and stops. The result is reported as blocked: the journey did not fail because of a bug, but nothing after that point was verified.
Why it costs you leads or sales
The steps behind a code prompt are often the most valuable: first login, onboarding, the activation event and the upgrade page. If monitoring stops at the code, a break there can go unseen for days. Real users hit the error and leave while your dashboard shows green.
- Signup formSubmits fine
- OTP promptCode sent to a phone or inbox the robot cannot read
- OnboardingNot reached
- Activation eventNot checked
The code step blocks the test, so later steps are unchecked.
Example: a 6-step signup journey, with and without a test path past the code step.
How to check if your site has it
- Your monitoring or QA run stops at a screen asking for a 6-digit code
- The test report says blocked, not failed
- Signup or login sends an SMS or email code every time
- No test account exists that skips or auto-fills the code
- Pages after login (dashboard, onboarding, billing) have never been tested automatically
How to fix it
Create a dedicated test account
Use a clearly named account (for example a test address on your own domain) with no real customer data and minimal permissions.
Choose a test path
Options: a TOTP secret for the test account that your test tool can compute; a fixed code that works only for that account in a non-production or allow-listed setup; or a trusted-device or remember-me session for the test account.
Restrict the path
Limit it to the test account, never a global bypass. Log its use and rotate any secret on a schedule.
Split the journey
Test the pre-code steps (form loads, submits, code prompt appears) as one journey. Cover the post-code steps with a separate journey that starts from a valid session if you can set one up.
Keep manual checks for the rest
If no safe path exists, test the code step and what follows by hand on a set schedule, for example weekly and after every release.
Use a test user
In Users > Add New, create a test user. If a 2FA plugin is active, check its settings for per-role or per-user options and use the plugin's own backup or authenticator method for that user.
Add a test-account rule
In your auth code, allow a TOTP secret or trusted-device token for a named test account only. Never accept a fixed code for all users.
Check the environment
Prefer a staging copy or an allow-list. If you must use production, keep the account's permissions minimal.
Keep test traffic out of reports
Test logins will trigger tags. Filter on the fg_test cookie or utm_source=funnelguard in GA4 so test sessions do not pollute reports.
import { authenticator } from 'otplib';
// Secret belongs to the dedicated test account only.
const secret = process.env.TEST_ACCOUNT_TOTP_SECRET;
const code = authenticator.generate(secret);
console.log(code);How to confirm it's fixed
- The test account passes the code step without a human reading a phone
- The journey reaches the dashboard or first onboarding screen
- The activation event fires and appears in your analytics
- A normal new user in a private window still gets the code prompt
- Test sessions are tagged and excluded from reports
How to prevent it happening again
Day 0
You change your auth provider settings. Onboarding after the code step starts erroring.
Day 1
Monitoring still reports blocked at the code step, which looks normal.
Day 5
Support tickets mention a blank screen after login.
Day 5
A test account with a safe path would have caught it on Day 0.
How FunnelGuard handles this
Questions people ask
Why does my automated test stop at the 2FA code screen?
The robot cannot read the SMS, email or authenticator app that receives the code. It reaches the prompt and stops, so the result is reported as blocked. Nothing after that step is tested.
How do I test a login that uses two-factor authentication?
Create a dedicated test account and give it a narrow test path, such as a TOTP secret your test tool can compute or a trusted-device session. Limit it to that account and log its use. Test real new-user flows by hand as well.
Should I turn off 2FA so my monitoring can run?
No. Disabling 2FA for real users weakens security and is not needed. Use a single test account with a restricted path instead.
Can a monitoring tool bypass OTP or CAPTCHA?
A responsible one does not. FunnelGuard never bypasses 2FA, CAPTCHAs or bot protection. It reports the step as blocked and checks what it can reach.
What does a blocked result mean in FunnelGuard?
It means the journey reached a 2FA or OTP step and could not continue. It does not mean your site is broken. The steps after the code remain unchecked, so cover them with a test path or manual checks.
How often should I test the steps behind a 2FA prompt by hand?
Weekly is a sensible minimum, plus after every release or change to your auth provider, SMS vendor or onboarding. Use a test account and note the date of each check.
Does a signup OTP step hurt tracking?
Not by itself. But if testing stops at the code, you will not see whether the signup or activation event fires after verification. Check it manually in GA4 or your ad platform's test tools.