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

Function clearChatGptOAuthCredentials

sdk/src/credentials.ts:156–171  ·  view source on GitHub ↗
(
  clientEnv: ClientEnv = env,
)

Source from the content-addressed store, hash-verified

154}
155
156export const clearChatGptOAuthCredentials = (
157 clientEnv: ClientEnv = env,
158): void => {
159 const credentialsPath = getCredentialsPath(clientEnv)
160 if (!fs.existsSync(credentialsPath)) {
161 return
162 }
163
164 try {
165 const existingData = JSON.parse(fs.readFileSync(credentialsPath, 'utf8'))
166 delete existingData.chatgptOAuth
167 fs.writeFileSync(credentialsPath, JSON.stringify(existingData, null, 2))
168 } catch {
169 // Ignore errors
170 }
171}
172
173export const isChatGptOAuthValid = (clientEnv: ClientEnv = env): boolean => {
174 const credentials = getChatGptOAuthCredentials(clientEnv)

Callers 2

disconnectChatGptOAuthFunction · 0.90

Calls 2

parseMethod · 0.80
getCredentialsPathFunction · 0.70

Tested by

no test coverage detected