Created
August 2, 2020 21:53
-
-
Save jodyheavener/609cbacdbcb5de9ec6314ea521efef32 to your computer and use it in GitHub Desktop.
PM2 DevTools - FxA Signin Code recipe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.addEventListener('pm2:log:inbox', (event) => { | |
| const otpForm = document.querySelector('.confirm-signup form') | |
| const otpField = otpForm.querySelector('.otp-code') | |
| const submitBtn = otpForm.querySelector('#submit-btn') | |
| const signInRegex = /Signin code (\d{6})/gm | |
| const signInCode = signInRegex.exec(event.detail) | |
| if (signInCode[1]) { | |
| console.log('Filling in signin code') | |
| otpField.value = signInCode[1] | |
| submitBtn.click() | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment