A valid access token for the account you want to approve logins for. This access token (not refresh token) must have been created using the MobileApp platform type.
Your account's TOTP shared secret. If this is a string, it must be hex- or base64-encoded.
Optional options: ConstructorOptionsConstructs a new LoginApprover instance. Example usage:
import {LoginApprover} from 'steam-session';
let approver = new LoginApprover('eyAid...', 'oTVMfZJ9uHXo3m9MwTD9IOEWQaw=');
An Error will be thrown if your accessToken isn't a well-formed JWT, if it's a refresh token rather than an
access token, or if it's an access token that was not generated using
EAuthTokenPlatformType.MobileApp.
A string or Buffer containing your shared secret. This is automatically set by the constructor, but
you can also manually assign it if you need to set a new shared secret for some reason.
If this is a string, it must be either hex- or base64-encoded.
Private _accessPrivate _webPrivate _handlerRead-only. A SteamID instance containing the SteamID for the account to which the provided accessToken belongs. Populated immediately after accessToken is set.
A string containing your access token. This is automatically set by the constructor, but you can also manually
assign it if you need to set a new access token.
An Error will be thrown when you set this property if you set it to a valid that isn't a well-formed JWT, if
it's a refresh token rather than an access token, or if it's an access token that was not generated using
EAuthTokenPlatformType.MobileApp.
Private _secretThe QR challenge URL from a startWithQR call
Retrieves info for an auth session given a QR challenge URL. Once you call this, remoteInteraction will be emitted. If the QR auth session was initiated within a legitimate Steam client or website, a loading indicator will be overlayed on the QR code to indicate that the session is being dealt with on a mobile device.
Approves or denies an auth session from a QR URL. If you pass true for
approve, then the next poll from the LoginSession
will return access tokens. If you pass false, then the LoginSession will emit an
error event with EResult FileNotFound.
Returns a Promise which resolves with no value. Once this Promise resolves, you could call forcePoll, and the LoginSession should then immediately emit authenticated.
Generated using TypeDoc
Using CommonJS:
Using ES6 modules:
The LoginApprover class can be used to approve a login attempt that was started with a QR code.
See
Example: approve-qr.ts