feat: implement smart scraper authentication with cookie persistence and visual status indicators

This commit is contained in:
2026-02-21 02:30:52 +01:00
parent e47e722e27
commit 7d49209c0b
2 changed files with 8 additions and 5 deletions

View File

@@ -495,7 +495,8 @@ ipcMain.handle('open-external', (event, url: string) => shell.openExternal(url))
ipcMain.handle('open-steam-login', async (event, expectedSteamId: string) => { ipcMain.handle('open-steam-login', async (event, expectedSteamId: string) => {
const loginSession = session.fromPartition('persist:steam-login'); const loginSession = session.fromPartition('persist:steam-login');
await loginSession.clearStorageData({ storages: ['cookies', 'localstorage', 'indexdb'] }); // Removed: automatic clearStorageData to allow cookie persistence
return new Promise<boolean>((resolve) => { return new Promise<boolean>((resolve) => {
const loginWindow = new BrowserWindow({ const loginWindow = new BrowserWindow({
width: 800, height: 700, parent: mainWindow || undefined, modal: true, title: 'Login to Steam', width: 800, height: 700, parent: mainWindow || undefined, modal: true, title: 'Login to Steam',

View File

@@ -510,18 +510,20 @@ const AccountRow: React.FC<{
)} )}
{/* Scraper Auth Button - Controls the optional cooldown tracking */} {/* Scraper Auth Button - Controls the optional cooldown tracking */}
<Tooltip title={account.steamLoginSecure ? "Refresh scraper session" : "Authenticate for cooldown tracking"}> <Tooltip title={account.steamLoginSecure && !account.authError ? "Session valid" : (account.steamLoginSecure ? "Refresh scraper session" : "Authenticate for cooldown tracking")}>
<IconButton <IconButton
size="small" size="small"
onClick={onAuth} onClick={onAuth}
disabled={!!(account.steamLoginSecure && !account.authError)}
sx={{ sx={{
color: account.steamLoginSecure ? 'success.main' : 'warning.main', color: account.steamLoginSecure && !account.authError ? 'success.main' : (account.authError ? 'error.main' : 'warning.main'),
border: '1px solid', border: '1px solid',
borderColor: 'divider', borderColor: 'divider',
borderRadius: 1 borderRadius: 1,
opacity: account.steamLoginSecure && !account.authError ? 0.6 : 1
}} }}
> >
{account.steamLoginSecure ? <BoltIcon fontSize="inherit" /> : <LockResetIcon fontSize="inherit" />} {account.steamLoginSecure && !account.authError ? <ShieldIcon fontSize="inherit" /> : (account.authError ? <LockResetIcon fontSize="inherit" /> : <BoltIcon fontSize="inherit" />)}
</IconButton> </IconButton>
</Tooltip> </Tooltip>