Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open npmjs.com instead of asking for OTP #726

Open
fregante opened this issue Dec 21, 2023 · 1 comment
Open

Open npmjs.com instead of asking for OTP #726

fregante opened this issue Dec 21, 2023 · 1 comment

Comments

@fregante
Copy link
Collaborator

Description

npm now asks to complete 2FA in the browser:

npm notice Publishing to https://registry.npmjs.org/ with tag latest and default access
Authenticate your account at:
https://www.npmjs.com/auth/cli/cda65f41-0edf4e1c6f4b
Press ENTER to open in the browser...

and I find this to be better than what np does:

? Select semver increment or specify new version major 	4.0.0

  ✔ Prerequisite check
  ✔ Git
  ✔ Bumping version using npm
  ⠴ Publishing package using npm (waiting for input…)
    → ? Enter OTP: 
    Pushing tags
    Creating release draft on GitHub

Is the feature request related to a problem?

Compare the two workflows:

  1. Press ENTER
  2. Click "Use security key" (on a pre-logged-in npmjs.com)
  3. Touch ID

with np's:

  1. Pick up phone
  2. Unlock it
  3. Find Authenticator
  4. Locate npm on the list
  5. Tap it
  6. cmd-v on the computer (via Continuity, if it works, within 4 seconds)

Possible implementation

I don't know, but it could skip the "Press enter to continue" step and just use open to open the browser and skip one more step.

Bonus points: this would also resolve another issue because "the notification" is the whole browser getting focus.

Issues

Potentially some people don't like this new workflow

@sindresorhus
Copy link
Owner

I personally prefer the current approach, but I'm happy to add an option for this.

My workflow is: Trigger 1Password quick window, copy 2FA for npm, paste into terminal. Much faster than jumping into the browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants