MCPcopy
hub / github.com/coder/mux / finishDeviceFlow

Method finishDeviceFlow

src/node/services/codexOauthService.ts:709–731  ·  view source on GitHub ↗
(flowId: string, result: Result<void, string>)

Source from the content-addressed store, hash-verified

707 }
708
709 private finishDeviceFlow(flowId: string, result: Result<void, string>): Promise<void> {
710 const flow = this.deviceFlows.get(flowId);
711 if (!flow || flow.settled) {
712 return Promise.resolve();
713 }
714
715 flow.settled = true;
716 clearTimeout(flow.timeout);
717 flow.abortController.abort();
718
719 try {
720 flow.resolveResult(result);
721 } finally {
722 if (flow.cleanupTimeout !== null) {
723 clearTimeout(flow.cleanupTimeout);
724 }
725 flow.cleanupTimeout = setTimeout(() => {
726 this.deviceFlows.delete(flowId);
727 }, COMPLETED_FLOW_TTL_MS);
728 }
729
730 return Promise.resolve();
731 }
732}

Callers 5

startDeviceFlowMethod · 0.95
waitForDeviceFlowMethod · 0.95
cancelDeviceFlowMethod · 0.95
disposeMethod · 0.95
pollDeviceFlowMethod · 0.95

Calls 4

resolveMethod · 0.80
getMethod · 0.65
abortMethod · 0.65
deleteMethod · 0.45

Tested by

no test coverage detected