Seeking to search out a scalable strategy of using puppeteer to login to third occasion dwelling on behalf of a person and enter 2FA if famous

Customarily what the title says. I wanted to compile some thoughts on the ideal technique to mark this.

I'm thinking there is a websocket beginning from the patron to a puppeteer browser which is able to let the patron react to what puppeteer sees. Float is one thing like

  1. The consumer has a login internet page which when submitted creates a websocket to my node container
  2. The node container creates a unique browser and logs in the person on the third occasion dwelling.
  3. If a 2FA is detected after that the node server tells the patron which then presentations a 2FA show conceal.
  4. Once the person submits the 2FA thru the socket connection puppeteer enters the facts and then internet scrapes the famous info from the headless browser,
  5. Finally the browser terminates and the websocket connection is terminated

Does this lope compile sense? One quiz I in actuality personal is how this would work across theoretically many of of logins. Can a node server without issues beginning multiple browsers with puppeteer?