Ensure WorkOS Auth token deletion when logging out (#7174)
* Ensure WorkOS Auth token deletion when logging out * Add changeset * refactor
This commit is contained in:
1 parent
3c1327b115
commit
9664ddd106
2 files changed
+12
-3
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Delete all Auth Tokens when logging out
|
||||
@@ -261,7 +261,7 @@ export class AuthService {
|
||||
telemetryService.captureAuthLoggedOut(this._provider.name, reason)
|
||||
this._clineAuthInfo = null
|
||||
this._authenticated = false
|
||||
this._controller.stateManager.setSecret("clineAccountId", undefined)
|
||||
this.destroyTokens()
|
||||
this.sendAuthStatusUpdate()
|
||||
} catch (error) {
|
||||
console.error("Error signing out:", error)
|
||||
@@ -293,8 +293,7 @@ export class AuthService {
|
||||
* This is typically called when the user logs out.
|
||||
*/
|
||||
async clearAuthToken(): Promise<void> {
|
||||
this._controller.stateManager.setSecret("clineAccountId", undefined)
|
||||
this._controller.stateManager.setSecret("cline:clineAccountId", undefined)
|
||||
this.destroyTokens()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -418,4 +417,9 @@ export class AuthService {
|
||||
// Update state in webviews once per unique controller
|
||||
await Promise.all(Array.from(uniqueControllers).map((c) => c.postStateToWebview()))
|
||||
}
|
||||
|
||||
private destroyTokens() {
|
||||
this._controller.stateManager.setSecret("clineAccountId", undefined)
|
||||
this._controller.stateManager.setSecret("cline:clineAccountId", undefined)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user