Group
  • Testing

    Test my auth edge cases before attackers do

    Cover session expiry, token reuse, logout behavior, and password reset abuse in your test suite.

    • Improve quality
    • Debug & fix
    • Intermediate
    • General

Free Prompt

My login works, but I want tests for the auth edge cases that turn into security issues or support tickets. Write tests covering: 1. Session expiry: an expired session or token is rejected, and the user is redirected to login rather than shown a broken page. 2. Logout: after logout, the old session or token no longer works, even if replayed. 3. Password reset: a reset link works once and only once, expires after its window, and an old reset link can't be reused after a newer one was issued. 4. Magic links or email confirmation tokens (if my app has them): single use, correct expiry, and they can't be used for a different account than they were issued to. 5. Brute force protection: repeated failed logins trigger whatever rate limiting or lockout my app is supposed to have. If it has none, flag that as a finding instead of writing a test that documents the hole. 6. Token tampering: a modified or forged token is rejected, not partially accepted. Assert response codes and user-facing behavior, not internal implementation details. Don't weaken security checks to make tests pass. If a test fails because the auth logic is genuinely broken, stop and show me the failure before touching the implementation. When done, run the suite and give me a list of which protections are verified and which are missing entirely.

What This Does / How This Helps

This tests the auth edge cases: session expiry, logout replay, single-use reset links, token tampering, and brute force behavior. Auth bugs don't show up in happy-path testing and they're painful in production. A reset link that works twice, a session that survives logout, or no login rate limiting are the kind of findings that end up in someone else's writeup about your app. Testing them before launch is cheap. Explaining them after is not.

Want to skip doing this by hand?

Fortivibe audits your app for all of the areas these prompts cover (and more).

See What We Check

Related Prompts