chore: proper auth handling (#65)

Co-authored-by: Shubham Naik <shub@memgpt.ai>
This commit is contained in:
Shubham Naik
2025-11-05 16:35:37 -08:00
committed by GitHub
parent cc73396e7a
commit 58362c9c46
2 changed files with 43 additions and 1 deletions

View File

@@ -669,7 +669,7 @@ export default function App({
kind: "command",
id: cmdId,
input: msg,
output: "Clearing credentials...",
output: "Logging out...",
phase: "running",
});
buffersRef.current.order.push(cmdId);
@@ -680,6 +680,14 @@ export default function App({
try {
const { settingsManager } = await import("../settings-manager");
const currentSettings = settingsManager.getSettings();
// Revoke refresh token on server if we have one
if (currentSettings.refreshToken) {
const { revokeToken } = await import("../auth/oauth");
await revokeToken(currentSettings.refreshToken);
}
// Clear local credentials
const newEnv = { ...currentSettings.env };
delete newEnv.LETTA_API_KEY;
// Note: LETTA_BASE_URL is intentionally NOT deleted from settings