Skip to content

Instantly share code, notes, and snippets.

@MylesBorins
Created April 21, 2022 20:55
Show Gist options
  • Save MylesBorins/02844588637be106462e729f74ed3299 to your computer and use it in GitHub Desktop.
Save MylesBorins/02844588637be106462e729f74ed3299 to your computer and use it in GitHub Desktop.
Allow for automation tokens when setting 2FA mode via CLI
diff --git a/workspaces/libnpmaccess/lib/index.js b/workspaces/libnpmaccess/lib/index.js
index 71219d009..27cebddec 100644
--- a/workspaces/libnpmaccess/lib/index.js
+++ b/workspaces/libnpmaccess/lib/index.js
@@ -169,7 +169,7 @@ function setRequires2fa (spec, required, opts = {}) {
return npmFetch(uri, {
...opts,
method: 'POST',
- body: { publish_requires_tfa: required },
+ body: { publish_requires_tfa: required, automation_token_overrides_tfa: required },
spec,
ignoreBody: true,
}).then(() => true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment