Fix login hanging indefinitely on steam-session timeout

Modern login in components/login.js listens for 'authenticated' and
'error' events from steam-session's LoginSession, but not the 'timeout'
event. When loginTimeout (default 30s) elapses, steam-session emits
'timeout' and calls cancelLoginAttempt() without emitting an 'error'
event, causing the Promise to never settle and the login callback to
never be called.

Add a 'timeout' event listener that rejects the Promise with a
descriptive error.
This commit is contained in:
Lucas
2026-07-03 10:02:04 +02:00
parent 00e82f7e79
commit 59090242f9

View File

@@ -68,6 +68,10 @@ SteamCommunity.prototype._modernLogin = function(logOnDetails) {
reject(err);
});
session.on('timeout', () => {
reject(new Error('Login timed out'));
});
try {
let startResult = await session.startWithCredentials({
accountName: logOnDetails.accountName,