MCPcopy
hub / github.com/triggerdotdev/trigger.dev / createAuthorizationCode

Function createAuthorizationCode

packages/cli-v3/src/commands/login.ts:324–355  ·  view source on GitHub ↗
(apiClient: CliApiClient)

Source from the content-addressed store, hash-verified

322}
323
324async function createAuthorizationCode(apiClient: CliApiClient) {
325 return await tracer.startActiveSpan("createAuthorizationCode", async (span) => {
326 try {
327 //generate authorization code
328 const createAuthCodeSpinner = spinner();
329 createAuthCodeSpinner.start("Creating authorization code");
330 const authorizationCodeResult = await apiClient.createAuthorizationCode();
331
332 if (!authorizationCodeResult.success) {
333 createAuthCodeSpinner.stop(
334 `Failed to create authorization code\n${authorizationCodeResult.error}`
335 );
336
337 throw new SkipLoggingError(
338 `Failed to create authorization code\n${authorizationCodeResult.error}`
339 );
340 }
341
342 createAuthCodeSpinner.stop("Created authorization code");
343
344 span.end();
345
346 return authorizationCodeResult.data;
347 } catch (e) {
348 recordSpanException(span, e);
349
350 span.end();
351
352 throw e;
353 }
354 });
355}

Callers 1

loginFunction · 0.70

Calls 6

spinnerFunction · 0.85
recordSpanExceptionFunction · 0.85
startActiveSpanMethod · 0.80
startMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…