Skip to content

Signing up for Discord? Some of our domains are accepted there. See which ones on the Domains page.

CyberTemp
All posts

How to QA Password Reset Flows Without Getting Locked Out

CyberTemp6 min read

Need a disposable inbox right now?

Spin up a temporary email address in seconds — no signup, no spam, no trace.

Get a free inbox

Password reset is the flow every team tests last and breaks first. Signup gets covered because it's on the happy path. Reset gets a single manual click-through before launch, and then it sits untouched until a support ticket says a user is locked out. The flow has more states than signup does — request, link, expiry, reuse, concurrent requests — and most of those states never see an automated test.

This is a QA and automation guide: how to script the reset flow's actual edge cases, not just the happy path, using a disposable inbox per test run.

Why reset breaks in ways signup doesn't

A signup confirmation email gets sent once, clicked once, and the account exists or it doesn't. A reset flow has a token with a lifespan, and that token can be requested twice, clicked twice, or clicked after the account already changed state. Most of the bugs that reach production live in that gap:

  • A second reset request invalidates the first link, but the UI still shows the first link as "sent" with no indication it's dead.

  • A token gets consumed on page load (not on form submit), so a security scanner or email client's link-preview bot burns the token before the user ever sees the form.

  • The reset link has no expiry enforced server-side, only client-side, so a stale email six months old still works.

  • Concurrent reset requests from two tabs both succeed, silently overwriting each other's password without any conflict warning.

None of these show up in a manual test where one person clicks one link one time. They show up when you script the flow to misbehave on purpose.

Give every test run its own inbox

The reason reset tests get skipped in CI isn't difficulty, it's inbox management. Reusing one test account across runs means every test either has to wait for the last reset email to clear or risks reading a stale token from a previous run. The fix is the same one that works for signup and OTP testing: a fresh throwaway address per test run, so there's no shared state to clean up between runs.

CyberTemp's inbox is created implicitly the first time you read it, so there's no separate provisioning step to script around:

import httpx
import re
import time

API_KEY = "tk_..."
HEADERS = {"X-API-Key": API_KEY}
BASE = "https://api.cybertemp.xyz"

def wait_for_reset_link(email, timeout=30, interval=2):
    deadline = time.time() + timeout
    while time.time() < deadline:
        resp = httpx.get(f"{BASE}/getMail", params={"email": email}, headers=HEADERS)
        resp.raise_for_status()
        messages = resp.json()
        if messages:
            body = messages[0].get("body", "")
            match = re.search(r'href="([^"]*reset-password[^"]*)"', body)
            if match:
                return match.group(1)
        time.sleep(interval)
    raise TimeoutError(f"No reset link for {email} within {timeout}s")

# run_id makes every test invocation get a distinct address
run_id = "reset-test-482"
test_email = f"{run_id}@cybertemp.xyz"

That address only needs to exist for the length of one test run. Delete it afterward with DELETE /inbox?email=... if you're running enough tests per day that inbox count against your plan limit matters — otherwise let it expire on its own.

Scripts worth writing before launch

Double request, single valid link

Request a reset twice for the same address in quick succession. Extract both links. Confirm the first one now returns an "expired or already used" state rather than silently succeeding. If both links still work, that's a real bug: it means a user's old, possibly-forwarded reset email stays live indefinitely.

Token replay

Use the same valid link twice — submit a new password, then try to reuse the identical link a second time with a different password. The second attempt should fail. If it doesn't, the reset token isn't being invalidated on use, which is a bigger security problem than a QA nit.

Expired token, tested for real

Don't just check that a countdown displays in the UI. If your reset tokens are supposed to expire in 60 minutes, either script a wait (fine for a nightly suite, not for a pre-commit hook) or, more practically, seed a token directly in a test database with an already-past expiry and confirm the endpoint rejects it. The email inbox doesn't matter for this one — the server-side check does.

Link-preview bots and prefetchers

Some corporate email gateways and mobile mail clients pre-fetch links inside emails to scan for malware before the user opens the message. If your reset link performs the state-changing action on GET instead of requiring a subsequent POST, that prefetch silently burns the token. Reproduce it by issuing a plain GET against the extracted link yourself, then confirming the human's later click still works.

Wiring it into CI

The pattern that holds up under a real test suite: one throwaway address per test case, a short polling loop with backoff instead of a fixed sleep, and a hard timeout so a broken deployment fails the build instead of hanging the pipeline for the full test-runner timeout.

def test_double_reset_invalidates_first_link():
    email = f"reset-double-{run_uuid()}@cybertemp.xyz"
    trigger_reset_request(email)
    link_one = wait_for_reset_link(email)

    trigger_reset_request(email)
    link_two = wait_for_reset_link(email, timeout=30)

    assert link_one != link_two
    assert submit_new_password(link_one, "NewPass123!") == "expired"
    assert submit_new_password(link_two, "NewPass123!") == "ok"

Run this alongside your existing signup and OTP tests rather than as a separate suite — the failure modes overlap enough (deliverability, token handling, rate limiting) that keeping them in one place makes flaky-test triage faster.

What to do when the rate limiter gets in the way

Reset endpoints are usually rate-limited harder than signup, because they're a common target for account-enumeration probing. If your test suite fires reset requests faster than production allows, you'll get throttled mid-run and see false failures that have nothing to do with your actual bug. Space out concurrent-request tests deliberately, and if you're running enough of these in parallel that a shared API key starts hitting 429 responses, back off with an exponential delay rather than retrying immediately — a tight retry loop against a rate limit just extends the outage from your side.


If you're testing a handful of reset scenarios by hand, the FREE tier is enough to generate a couple of throwaway inboxes in the browser and watch the links land. Once reset testing becomes part of a real CI suite — one inbox per test case, running on every merge — the ECO and CORE tiers raise the concurrent-inbox and request-per-day limits past what ad hoc testing needs, and CORE and ELITE unlock the OTP-extraction helpers in the Go SDK if part of your flow needs a numeric code instead of a link. Compare the tiers against how many test runs you actually fire per day before picking one.

For a broader look at fitting a plan to a workflow rather than guessing, see how to pick the right CyberTemp plan for your workflow. If password reset is the first flow you're scripting, wiring CyberTemp into signup-flow tests covers the simpler starting case first, and handling rate limits and retries goes deeper on the backoff pattern used above.

Share
    How to QA Password Reset Flows Without Getting Locked Out | CyberTemp Blog