fix(portal): configurable MFA timeout + skip IMAP poll on device-recognized login - #19
Merged
mattebad merged 1 commit intoAug 31, 2026
Conversation
…gnized login - Add GmailImapConfig.mfa_timeout_seconds (env GMAIL_IMAP_TIMEOUT_SECONDS, default 300) and thread it through the poll_gmail_imap_for_code MFA provider, so slow email delivery no longer hits the hard-coded 120s ceiling. - When the portal advances past MFA without delivering an email (EdFinancial recognises a trusted device/credentials), detect it via _looks_logged_in / _looks_like_mfa and skip the IMAP poll instead of hanging until timeout.
Owner
|
Thanks for the work on this. Approved |
mattebad
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two MFA rough edges hit on EdFinancial (and any servicer with similar behavior):
poll_gmail_imap_for_codedefaults to 120s. When the code email is slow, the run times out even though the code eventually arrives.Fix
GmailImapConfig.mfa_timeout_seconds(envGMAIL_IMAP_TIMEOUT_SECONDS, default 300) and thread it through thepoll_gmail_imap_for_codeMFA provider in all three call sites, so slow delivery no longer hits the 120s ceiling._looks_logged_in/_looks_like_mfa. If it has already advanced past MFA, log it and skip the IMAP poll instead of blocking until timeout.Notes
poll_gmail_imap_for_codealready acceptstimeout_seconds; this just makes it configurable and wires the default through.