You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 28, 2025. It is now read-only.
When I try to log in it never asks me for the 2FA code I have set up in my account.
I had to edit the "getTokens" function in the "login.js" file to make it ask me for the code so I can use the CLI. I would like to be able to open a PR with the modified changes, but given the structure of the project I don't know how to approach it in the best way.
I leave you the piece of code I made:
// (in line 10)constTFA='https://bambulab.com/api/sign-in/tfa';// (in line 138)if(code===200){res.on('data',d=>{constjson=JSON.parse(d);logger.debug(`JSON`,JSON.stringify(json,null,4));if(json.tfaKey){consttfa=rl.question(`[bambulab.com] 2FA code: `);consttfaPayload=JSON.stringify({tfaKey: json.tfaKey,tfaCode: tfa});consttfaEndpoint=parse(TFA);tfaEndpoint.method='POST';tfaEndpoint.headers={'content-type': 'application/json','content-length': tfaPayload.length};consttfaReq=https.request(tfaEndpoint,(tfaRes)=>{
...
});tfaReq.write(tfaPayload);tfaReq.end();}});}
Hi!
When I try to log in it never asks me for the 2FA code I have set up in my account.
I had to edit the "getTokens" function in the "login.js" file to make it ask me for the code so I can use the CLI. I would like to be able to open a PR with the modified changes, but given the structure of the project I don't know how to approach it in the best way.
I leave you the piece of code I made: