Jump to content
McKay Development

identity secret validation


TheMaster

Recommended Posts

i want to validate if a user entered rhe identity secrect correctly so my plan that i implemented was that i will create a api key and handle the confrim mation to see if the api key creates but as th apikey is already created and the steam servers are constantly replying Busy 
Iwant to know if there is a easy way of verifying this 
Currrent code
 

async function createSteamApiKey() {
        return new Promise((resolve, reject) => {
            const retryDelay = 30000; // 30 seconds
            const retryLimit = 1; // Retry limit
            let retryCount = 0;
   
            function attemptCreateKey() {
                if (retryCount >= retryLimit) {
                    console.log(`Retry limit exceeded. Setting isbusy to true.`);
                    isbusy = true; // Permanently set isbusy to true
                    return resolve(false); // Resolve the promise to stop further execution
                }
   
                console.log(`Attempting to create Web API key (Attempt ${retryCount + 1})...`);
                const options = {
                    domain: "localhost",
                    identitySecret: identity
                };
   
                community.createWebApiKey(options, (err, result) => {
                    if (err) {
                        if (err.eresult === 10) { // Busy error
                            console.log("API busy, retrying in 30 seconds...");
                            retryCount++;
                            return setTimeout(attemptCreateKey, retryDelay);
                        }
                        return reject(err); // Handle other errors
                    }
   
                    if (result.confirmationRequired) {
                        console.log("Mobile confirmation is required to create the Web API key.");
                        return resolve({ confirmationRequired: true, finalizeOptions: result.finalizeOptions });
                    }
   
                    console.log("API key created successfully: " + result.apiKey);
                    isbusy = false; // Reset isbusy to false if successful
                    resolve(result.apiKey); // Resolve the promise with API key
                });
            }
   
            attemptCreateKey(); // Start the attempt
        });
    }

Update: the steamservers only return buys if we try to create a api on top of a api the thing that was writtten in the docs has now been set to true 
i read the doc idk if i am blind but i didnt saw a function to delete/revoke the webapi

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