MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getAuthTokenDetails

Function getAuthTokenDetails

cli/src/utils/auth.ts:115–129  ·  view source on GitHub ↗
(
  ciEnv: CiEnv = getCiEnv(),
)

Source from the content-addressed store, hash-verified

113 * Resolve the auth token and track where it came from.
114 */
115export const getAuthTokenDetails = (
116 ciEnv: CiEnv = getCiEnv(),
117): AuthTokenDetails => {
118 const userCredentials = getUserCredentials()
119 if (userCredentials?.authToken) {
120 return { token: userCredentials.authToken, source: 'credentials' }
121 }
122
123 const envToken = ciEnv.CODEBUFF_API_KEY
124 if (envToken) {
125 return { token: envToken, source: 'environment' }
126 }
127
128 return { source: null }
129}
130
131/**
132 * Get the auth token from user credentials or environment variable

Callers 7

AppWithAsyncAuthFunction · 0.90
getCodebuffClientFunction · 0.90
releaseFreebuffSlotFunction · 0.90
useFreebuffSessionFunction · 0.90
getAuthTokenFunction · 0.85
hasAuthCredentialsFunction · 0.85

Calls 2

getCiEnvFunction · 0.90
getUserCredentialsFunction · 0.70

Tested by

no test coverage detected