eg: TODO locator for 2FA text (email or app?)
This commit is contained in:
parent
5babbb6bc1
commit
351670f426
1 changed files with 1 additions and 0 deletions
|
|
@ -86,6 +86,7 @@ try {
|
||||||
// handle MFA, but don't await it
|
// handle MFA, but don't await it
|
||||||
page.waitForNavigation({ url: '**/id/login/mfa**'}).then(async () => {
|
page.waitForNavigation({ url: '**/id/login/mfa**'}).then(async () => {
|
||||||
console.log('Enter the security code to continue - This appears to be a new device, browser or location. A security code has been sent to your email address at ...');
|
console.log('Enter the security code to continue - This appears to be a new device, browser or location. A security code has been sent to your email address at ...');
|
||||||
|
// TODO locator for text (email or app?)
|
||||||
const otp = cfg.eg_otpkey && authenticator.generate(cfg.eg_otpkey) || await prompt({type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!'}); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them
|
const otp = cfg.eg_otpkey && authenticator.generate(cfg.eg_otpkey) || await prompt({type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!'}); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them
|
||||||
await page.type('input[name="code-input-0"]', otp.toString());
|
await page.type('input[name="code-input-0"]', otp.toString());
|
||||||
await page.click('button[type="submit"]');
|
await page.click('button[type="submit"]');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue