MCPcopy Index your code
hub / github.com/anomalyco/opencode / waitForOAuthCallback

Function waitForOAuthCallback

packages/opencode/src/plugin/digitalocean.ts:142–165  ·  view source on GitHub ↗
(state: string)

Source from the content-addressed store, hash-verified

140}
141
142function waitForOAuthCallback(state: string): Promise<ImplicitTokenPayload> {
143 return new Promise((resolve, reject) => {
144 const timeout = setTimeout(
145 () => {
146 if (pendingOAuth) {
147 pendingOAuth = undefined
148 reject(new Error("OAuth callback timeout - authorization took too long"))
149 }
150 },
151 5 * 60 * 1000,
152 )
153 pendingOAuth = {
154 state,
155 resolve: (tokens) => {
156 clearTimeout(timeout)
157 resolve(tokens)
158 },
159 reject: (error) => {
160 clearTimeout(timeout)
161 reject(error)
162 },
163 }
164 })
165}
166
167async function listRouters(
168 bearer: string,

Callers 1

authorizeFunction · 0.70

Calls 2

resolveFunction · 0.70
rejectFunction · 0.50

Tested by

no test coverage detected