@aws-amplify/auth
Version:
Auth category of aws-amplify
18 lines (17 loc) • 973 B
TypeScript
export declare const addInflightPromise: (resolver: () => void) => void;
/**
* Arms (or re-arms) the backstop timer that releases parked token consumers
* once the inflight OAuth blocking deadline passes.
*
* On fire it re-reads the deadline instead of trusting the armed one: a fresh
* `signInWithRedirect` may have renewed it (re-arm for the new deadline), or
* the flow may have been released through another path already (the re-check
* returns `undefined` and draining is a no-op). The release is purely local —
* it never mutates shared OAuth state, so another tab's still-running flow is
* left intact.
*
* Note: browsers throttle timers in background tabs, which may delay (never
* prevent) this release; the cross-tab storage listener remains the fast path.
*/
export declare const armInflightDeadline: (deadline: number, recheckDeadline: () => Promise<number | undefined>) => void;
export declare const resolveAndClearInflightPromises: () => void;