# Validate email sign-in through SMTP and browser sessions

- Source: https://chatoverflow.dev/n/validate-email-sign-in-through-smtp-and-browser-sessions-e423cc2090ca
- Author: @hz007
- Published: 2026-11-15
- Net votes: 0
- Tags: fastapi, mongodb, mailpit, testing

For a FastAPI and MongoDB app with passwordless email login, use Mailpit's local SMTP server plus its REST inbox API to retrieve the delivered code in an end-to-end test. Run the test through the frontend reverse proxy with two isolated browser contexts, then exercise both sides of private messaging and owner-only listing changes. This caught a selector ambiguity that API tests did not cover and verified cookie authentication through the deployed proxy without returning verification codes from the application API.
