Jump to content
McKay Development

Confusion with the login system and the web sessions


BolverBlitz

Recommended Posts

Hey there,
hope someone that used this can help me understand this login system better.
What i need: A webSession
How i get that: webSession Event emiter

I want to use this remember token (loginKey from the event) aswell as storing the password plain text (I know stupid) as optional parameter. Application should be able to run a long time.
My problem is, that i do not get a webSession even all the time, as said in docs "NOTE: If you log on this way, webSession will NOT be emitted automatically, and you will need to use webLogOn() to get a web session." but here my problem starts, i don´t know how to use webLogOn(), IDE tells me i need nothing, i tryed the client, and steamID objects. Both didn´t work.

The other thing is, i wrote some logic to handle logins and to store username + password (optional) in a config file. However it sometimes just logs me in. Without using that config file. Even when i used "rememberPassword: false".
Here the code:

/**
 * Login into steam as normal steam client
 * @param {Json} [config]
 */
const Steam_login = (config = global_config) => {
    if (fs.existsSync('./loginkey')) {
        log.info("Login with loginkey")
        client.logOn({
            accountName: config.Steam_Username,
            loginKey: fs.readFileSync('loginkey', 'utf8'),
        })
    } else {
        if (config.Steam_Password !== "") {
            log.info("Login with username & password")
            client.logOn({
                "accountName": config.Steam_Username,
                "password": config.Steam_Password,
                rememberPassword: false
            });
        } else {
            log.error("Login with loginKey failed and no password was found. EXIT")
            process.exit(1)
        }
    }
}

This logs me in without loginkey on my FS AND without the password stored, i don´t get how or why.

I´ve pushed the full code here ( https://github.com/BolverBlitz/BulkSteamKeyQueueActivator ) currently it doesn´t anything but logging in.

This is my output and config file. I don´t know why it logs in :(
simage.thumb.png.0f282f783f33c205cb86597b85d997f2.png

Any help or enlightenment would be nice, or a nudge to the docs to clear this up for me. I´m sorry if i just overlooked something...

Link to comment
Share on other sites

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...