MCPcopy Index your code
hub / github.com/coder/mux / finishGithubDeviceFlow

Method finishGithubDeviceFlow

src/node/services/serverAuthService.ts:817–842  ·  view source on GitHub ↗
(
    flowId: string,
    result: Result<{ sessionId: string; sessionToken: string }, string>
  )

Source from the content-addressed store, hash-verified

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 {

Callers 4

startGithubDeviceFlowMethod · 0.95
pollGithubDeviceFlowMethod · 0.95

Calls 2

getMethod · 0.65
deleteMethod · 0.45

Tested by

no test coverage detected