fix: explicitly clear storage for new account logins to prevent session leakage

This commit is contained in:
2026-02-21 03:19:00 +01:00
parent 75accbe5b6
commit 9d5f77dc09

View File

@@ -528,6 +528,12 @@ ipcMain.handle('open-steam-login', async (event, expectedSteamId: string) => {
const partitionId = expectedSteamId ? `persist:steam-login-${expectedSteamId}` : 'persist:steam-login-new';
const loginSession = session.fromPartition(partitionId);
// If adding a brand new account, explicitly clear previous trash
if (!expectedSteamId) {
console.log('[Auth] Clearing session for new account login...');
await loginSession.clearStorageData({ storages: ['cookies', 'localstorage', 'indexdb'] });
}
// If we have an existing cookie string for this account, pre-inject it
if (expectedSteamId) {
const accounts = store.get('accounts') as Account[];