PW: replace deprecated type() with pressSequentially() for OTPs
This commit is contained in:
parent
840d35c2d2
commit
41f1f95509
4 changed files with 5 additions and 5 deletions
|
|
@ -68,7 +68,7 @@ try {
|
|||
console.log('Two-Step Verification - enter the One Time Password (OTP), e.g. generated by your Authenticator App');
|
||||
await page.check('[name=rememberDevice]');
|
||||
const otp = cfg.pg_otpkey && authenticator.generate(cfg.pg_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=otpCode]', otp.toString());
|
||||
await page.locator('input[name=otpCode]').pressSequentially(otp.toString());
|
||||
await page.click('input[type="submit"]');
|
||||
}).catch(_ => { });
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue