Np: Accept the 2FA (otp) token after 6 characters

Created on 20 Aug 2018  路  10Comments  路  Source: sindresorhus/np


Issuehunt badges

Instead of having to press Enter. Would save a tiny bit of time.




IssueHunt Summary

lukks lukks has been rewarded.

Backers (Total: $30.00)

Submitted pull Requests

- #493 Auto submit 2fa

Tips

IssueHunt has been backed by the following sponsors. Become a sponsor


Rewarded on Issuehunt enhancement help wanted

All 10 comments

Hey, this is what is handled by listr-input used inside lib/publish.js right? I would like to take a stab at it.

@killynathan Correct. Go ahead :)

@issuehuntfest has funded $30.00 to this issue. See it on IssueHunt

@sindresorhus I went through the source of listr-input and Inquirer.js, still didn't find anyway to implement this. What do you think?

Maybe we could use a library like RobotJS alongside with the validate function from listr-input to detect when 6 characters have been typed and then press the Enter key.

@sindresorhus @shaminmeerankutty

@xxczaki No, that's way over the top.

I would add an option to listr-input to validate the input in real-time instead of only after Enter.

@yaodingyd do you want to send a PR for this? If not, I could

the latest version for listr-input is not working actually. I have a PR https://github.com/SamVerschueren/listr-input/pull/8 to fix the auto submit issue. If you can ping Sam on it that would be helpful.

@sindresorhus has rewarded $27.00 to @lukks. See it on IssueHunt

  • :moneybag: Total deposit: $30.00
  • :tada: Repository reward(0%): $0.00
  • :wrench: Service fee(10%): $3.00
Was this page helpful?
0 / 5 - 0 ratings