MCPcopy
hub / github.com/prisma/prisma / getTokens

Method getTokens

packages/cli/src/management-api/token-storage.ts:30–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 }
29
30 async getTokens(): Promise<Tokens | null> {
31 try {
32 // Get all credentials - if there are multiple workspaces, use the first one
33 // In the future, we might want to support selecting a specific workspace
34 const allCredentials = await this.credentialsStore.getCredentials()
35 if (allCredentials.length === 0) {
36 return null
37 }
38 // Use the first workspace's credentials
39 // The SDK will extract workspaceId from the token, so this should match
40 const credentials = allCredentials[0]
41 return credentialsToTokens(credentials)
42 } catch (error: unknown) {
43 debug(error)
44 return null
45 }
46 }
47
48 async setTokens(tokens: Tokens): Promise<void> {
49 const credentials = tokensToCredentials(tokens)

Callers 3

parseMethod · 0.95
resolveApiClientFunction · 0.95
clearTokensMethod · 0.95

Calls 3

credentialsToTokensFunction · 0.85
debugFunction · 0.85
getCredentialsMethod · 0.80

Tested by

no test coverage detected