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

Function getPersonalAccessToken

packages/cli-v3/src/commands/login.ts:293–322  ·  view source on GitHub ↗
(apiClient: CliApiClient, authorizationCode: string)

Source from the content-addressed store, hash-verified

291}
292
293async function getPersonalAccessToken(apiClient: CliApiClient, authorizationCode: string) {
294 return await tracer.startActiveSpan("getPersonalAccessToken", async (span) => {
295 try {
296 const token = await apiClient.getPersonalAccessToken(authorizationCode);
297
298 if (!token.success) {
299 throw new AbortError(token.error);
300 }
301
302 if (!token.data.token) {
303 throw new Error("No token found yet");
304 }
305
306 span.end();
307
308 return {
309 token: token.data.token.token,
310 obfuscatedToken: token.data.token.obfuscatedToken,
311 };
312 } catch (e) {
313 if (e instanceof AbortError) {
314 recordSpanException(span, e);
315 }
316
317 span.end();
318
319 throw e;
320 }
321 });
322}
323
324async function createAuthorizationCode(apiClient: CliApiClient) {
325 return await tracer.startActiveSpan("createAuthorizationCode", async (span) => {

Callers 1

loginFunction · 0.85

Calls 3

recordSpanExceptionFunction · 0.85
startActiveSpanMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…