feat/revoke-share #3
@@ -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-external', (event, url: string) => shell.openExternal(url));
|
||||||
|
|
||||||
ipcMain.handle('open-steam-app-login', async () => {
|
ipcMain.handle('open-steam-app-login', async () => {
|
||||||
console.log('[SteamClient] Triggering desktop login window...');
|
console.log('[SteamClient] Preparing for fresh login...');
|
||||||
// Force Steam to show login window.
|
await killSteam();
|
||||||
// steam://open/login is the protocol for this.
|
|
||||||
|
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<void>((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';
|
const command = process.platform === 'win32' ? 'start steam://open/login' : 'xdg-open steam://open/login';
|
||||||
exec(command);
|
exec(command);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user