Trigger auth status update on secret storage change (#4837)
* 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. * restore * afgain --------- Co-authored-by: abeatrix <beatrix@cline.bot>
This commit is contained in:
1 parent
c38f443ec4
commit
17200740a8
2 files changed
+10
-1
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user