mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2026-08-31 03:47:59 +08:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user