Handle LoginSession events
masterThe LoginSession emits several events during the authentication lifecycle. It is critical to handle the error event, as failing to do so will cause Node.js to crash.
Key Events:
polling: Emitted when the session starts periodically checking Steam to see if the login succeeded. Polling begins after credentials are provided (and guards are satisfied) or after a Steam Guard code is submitted.timeout: Emitted if theloginTimeoutperiod elapses before authentication succeeds. This triggers an internal call tocancelLoginAttempt.remoteInteraction: Emitted when Steam reports a "remote interaction" (e.g., when a user views the approval prompt in the Steam mobile app for aDeviceConfirmationguard, or after a QR code is scanned but before it is approved/denied).steamGuardMachineToken: Emitted when logging into an account with email-based Steam Guard usingEAuthTokenPlatformType.SteamClient. The new token is available in thesteamGuardMachineTokenproperty.authenticated: Emitted upon successful authentication. At this point,accountNameandrefreshTokenare populated. If using an appropriateEAuthTokenPlatformType, you can now callgetWebCookies.error: Emitted if an error occurs during polling. The first argument is anErrorobject. The login attempt has failed and must be retried with a newLoginSession.