@@ -95,6 +95,14 @@ export function activate(context: vscode.ExtensionContext) {
9595 console . dir ( data )
9696 context . secrets . store ( "pearaiApiKey" , data . accessToken )
9797 context . secrets . store ( "pearaiRefreshKey" , data . refreshToken )
98+ const provider = await ClineProvider . getInstance ( )
99+ if ( provider ) {
100+ // Update the API configuration to clear the PearAI key
101+ await provider . setValues ( {
102+ pearaiApiKey : data . accessToken ,
103+ } )
104+ await provider . postStateToWebview ( )
105+ }
98106 // Update MCP server with new token
99107 // const provider = await ClineProvider.getInstance()
100108 // if (provider) {
@@ -112,8 +120,18 @@ export function activate(context: vscode.ExtensionContext) {
112120 console . dir ( "Logged out of PearAI:" )
113121 context . secrets . delete ( "pearaiApiKey" )
114122 context . secrets . delete ( "pearaiRefreshKey" )
115- // Clear MCP server token
123+
124+ // Get the current provider instance and update webview state
116125 const provider = await ClineProvider . getInstance ( )
126+ if ( provider ) {
127+ // Update the API configuration to clear the PearAI key
128+ await provider . setValues ( {
129+ pearaiApiKey : undefined ,
130+ } )
131+ await provider . postStateToWebview ( )
132+ }
133+ // Clear MCP server token
134+ // const provider = await ClineProvider.getInstance()
117135 // if (provider) {
118136 // const mcpHub = provider.getMcpHub()
119137 // if (mcpHub) {
0 commit comments