Jump to content
McKay Development

Recommended Posts

Posted
const { LoginSession, EAuthTokenPlatformType } = require('steam-session');
const qrcode = require('qrcode-terminal');

// We need to wrap everything in an async function since node <14.8 cannot use await in the top-level context
main();
async function main() {
	// Create our LoginSession and start a QR login session.
	let session = new LoginSession(EAuthTokenPlatformType.MobileApp);
	session.loginTimeout = 120000; // timeout after 2 minutes
	let startResult = await session.startWithQR();

	qrcode.generate(startResult.qrChallengeUrl, { small: true });

	session.on('remoteInteraction', () => {
		console.log('Looks like you\'ve scanned the code! Now just approve the login.');
	});

	// No need to handle steamGuardMachineToken since it's only applicable to accounts using email Steam Guard,
	// and such accounts can't be authed using a QR code.

	session.on('authenticated', async () => {
		console.log('\nAuthenticated successfully! Printing your tokens now...');
		console.log(`SteamID: ${session.steamID}`);
		console.log(`Account name: ${session.accountName}`);
		console.log(`Access token: ${session.accessToken}`);
		console.log(`Refresh token: ${session.refreshToken}`);

		// We can also get web cookies now that we've negotiated a session
		let webCookies = await session.getWebCookies();
		console.log('Web session cookies:');
		console.log(webCookies);
	});

	session.on('timeout', () => {
		console.log('This login attempt has timed out.');
	});

	session.on('error', (err) => {
		// This should ordinarily not happen. This only happens in case there's some kind of unexpected error while
		// polling, e.g. the network connection goes down or Steam chokes on something.
		console.log(`ERROR: This login attempt has failed! ${err.message}`);
	});
}

response:
 

QRCODE...
Looks like you've scanned the code! Now just approve the login.
ERROR: This login attempt has failed! FileNotFound

 

Posted (edited)
5 hours ago, Dr. McKay said:

Did you decline the login on your mobile device? That's what I've seen cause FileNotFound.

 I accepted the login over the phone and closed the dialog box with security questions about the login sample questions: are you trying to pick up a free skin or are you trying to enter a tournament

Edited by THEzombiePL
Additional information
Posted

 I already found the reason and solved it, it was the fault that I use vpn and closing the dialog box with security questions worked for logging in with steamguard code but automatically rejects logging in with qr code.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...