(sessionId: string)
| 51 | * (the OAuth flow is still in progress, or the user abandoned it). |
| 52 | */ |
| 53 | export const consumeOAuthResult = (sessionId: string): AnyResult | null => { |
| 54 | const now = Date.now(); |
| 55 | cleanupExpired(now); |
| 56 | const entry = store.get(sessionId); |
| 57 | if (!entry) return null; |
| 58 | store.delete(sessionId); |
| 59 | return entry.result; |
| 60 | }; |
| 61 | |
| 62 | /** Test-only — clears the entire store between tests. */ |
| 63 | export const __resetOAuthResultStoreForTests = (): void => { |
no test coverage detected