(
flowId: string,
result: Result<{ sessionId: string; sessionToken: string }, string>
)
| 815 | } |
| 816 | |
| 817 | private finishGithubDeviceFlow( |
| 818 | flowId: string, |
| 819 | result: Result<{ sessionId: string; sessionToken: string }, string> |
| 820 | ): void { |
| 821 | const flow = this.githubDeviceFlows.get(flowId); |
| 822 | if (!flow || flow.cancelled) { |
| 823 | return; |
| 824 | } |
| 825 | |
| 826 | flow.cancelled = true; |
| 827 | clearTimeout(flow.timeout); |
| 828 | |
| 829 | try { |
| 830 | flow.resolveResult(result); |
| 831 | } catch { |
| 832 | // Result already resolved. |
| 833 | } |
| 834 | |
| 835 | if (flow.cleanupTimeout !== null) { |
| 836 | clearTimeout(flow.cleanupTimeout); |
| 837 | } |
| 838 | |
| 839 | flow.cleanupTimeout = setTimeout(() => { |
| 840 | this.githubDeviceFlows.delete(flowId); |
| 841 | }, COMPLETED_FLOW_TTL_MS); |
| 842 | } |
| 843 | |
| 844 | private async loadPersistedSessionsLocked(): Promise<PersistedServerAuthData> { |
| 845 | try { |
no test coverage detected