From 2719bd527a000b4cb27a1c97e5ef5389d367a20d Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Sat, 21 Feb 2026 03:11:56 +0100 Subject: [PATCH] fix: ensure fresh Steam login on Add by killing process and clearing auto-login state --- frontend/electron/main.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/frontend/electron/main.ts b/frontend/electron/main.ts index 215e173..ec1df1c 100644 --- a/frontend/electron/main.ts +++ b/frontend/electron/main.ts @@ -506,9 +506,18 @@ ipcMain.handle('switch-account', async (event, loginName: string) => await handl ipcMain.handle('open-external', (event, url: string) => shell.openExternal(url)); ipcMain.handle('open-steam-app-login', async () => { - console.log('[SteamClient] Triggering desktop login window...'); - // Force Steam to show login window. - // steam://open/login is the protocol for this. + console.log('[SteamClient] Preparing for fresh login...'); + await killSteam(); + + if (process.platform === 'win32') { + // Clear auto-login registry + const clearReg = 'reg add "HKCU\\Software\\Valve\\Steam" /v AutoLoginUser /t REG_SZ /d "" /f'; + await new Promise((res) => exec(clearReg, () => res())); + } else if (process.platform === 'linux') { + // On Linux we can use the steamClient helper to set an empty user + await steamClient.setAutoLoginUser("", undefined, ""); + } + const command = process.platform === 'win32' ? 'start steam://open/login' : 'xdg-open steam://open/login'; exec(command); return true;