Compare commits

...
Author SHA1 Message Date
abeatrix b80ee86b69 afgain 2025-07-11 12:41:52 -07:00
abeatrix 3262f721f0 restore 2025-07-11 12:29:18 -07:00
abeatrix 22f917a7da Trigger auth status update on secret storage change
The auth status should be updated when the clineAccountId secret changes. This commit adds a listener to the secrets.onDidChange event and calls sendAuthStatusUpdate when the clineAccountId secret changes. This ensures that the auth status is always up-to-date.
2025-07-11 12:27:14 -07:00
2 changed files with 10 additions and 1 deletions
+8
View File
@@ -685,6 +685,14 @@ export async function activate(context: vscode.ExtensionContext) {
}),
)
context.subscriptions.push(
context.secrets.onDidChange((event) => {
if (event.key === "clineAccountId") {
AuthService.getInstance(context)?.restoreAuthToken()
}
}),
)
return createClineAPI(outputChannel, sidebarWebview.controller)
}
+2 -1
View File
@@ -100,6 +100,7 @@ export class AuthService {
})
this._setProvider(authProviders.find((authProvider) => authProvider.name === providerName).name)
this._context = context
}
@@ -118,7 +119,7 @@ export class AuthService {
}
AuthService.instance = new AuthService(context, config || {}, authProvider)
}
if (context) {
if (context !== undefined) {
AuthService.instance.context = context
}
return AuthService.instance