diff --git a/src/auth/commands/show-command.ts b/src/auth/commands/show-command.ts index 7f0c5f1a..12a2a0e7 100644 --- a/src/auth/commands/show-command.ts +++ b/src/auth/commands/show-command.ts @@ -26,8 +26,13 @@ export async function handleShow(ctx: CommandContext, args: string[]): Promise { return; } - // Delete the profile (legacy/unified) - registry.deleteProfile(name); + // Delete from appropriate config (unified and/or legacy) + let deleted = false; + if (isUnifiedMode() && registry.hasAccountUnified(name)) { + registry.removeAccountUnified(name); + deleted = true; + } + if (registry.hasProfile(name)) { + registry.deleteProfile(name); + deleted = true; + } + + if (!deleted) { + res.status(404).json({ error: `Account not found: ${name}` }); + return; + } res.json({ success: true, deleted: name }); } catch (error) {