()
| 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) |
no test coverage detected