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

#398 Check for two factor auth on publish #402

Closed
wants to merge 2 commits into from

Conversation

jdziat
Copy link
Contributor

@jdziat jdziat commented May 5, 2019

#398
Added a check for two-factor auth === enabled before proceeding. Unless the intention was to force 2FA as a best practice. I was looking for a transparent approach but will happily change it to a flag if that makes more sense.

@itaisteinherz
Copy link
Collaborator

Could you move the code which determines if the user has enabled 2FA on their account to a separate method in source/npm/util.js (e.g. hasEnabled2fa), and then use it in the skip property here?
This way the functionality would be more reusable and maintainable.

Also: in

if (!options.exists && !pkg.private) {

I think that the && !pkg.private part of the clause should be changed to && runPublish.

@sindresorhus
Copy link
Owner

Unless the intention was to force 2FA as a best practice.

That was the intention, yes.

@wessberg
Copy link

wessberg commented May 6, 2019

Unless the intention was to force 2FA as a best practice.

That was the intention, yes.

In my original issue, #398 , I'm suggesting opt-out, rather than opt-in. I agree that 2FA by default is good, so I'm in favor of something like --no-2fa to explicitly request this behavior (similar to the other existing flags)

@sindresorhus
Copy link
Owner

I'm ok with a --no-2fa flag, but the docs for it should have a clear discouragement warning.

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

Successfully merging this pull request may close these issues.

4 participants