Jump to content
McKay Development

Recommended Posts

Posted

On steamGuard event I am using an async method to get authCode and it just looping again and again here to get a new one with lastCodeWrong = true. If using sync method to get code then everything is works well.
 

this.steamClient.on('steamGuard', async (domain, callback, lastCodeWrong) => {
            logger.info("Need code");
            console.log(lastCodeWrong);
            if(lastCodeWrong){
                throw new Error("To many consecutive wrong GUARD CODE")
            }
            try {
                const code = await this.generateAuthCode();
                callback(code);
            } catch (e) {
                console.log(e);
            }
        });
 private async generateAuthCode(): Promise<string> {
        let offset: number | undefined;
 
        try {
            offset = await this.getTimeOffset;
            console.log('Offset:' + offset)
        } catch (err) {
            // ignore error
        }
 
        return SteamTotp.generateAuthCode(this.auth, offset);
    }

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