Skip to content

Commit cf56622

Browse files
committed
fix(publish): OTP cache should be seeded from conf value, not CLI directly
1 parent 2fa02a8 commit cf56622

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

commands/publish/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ class PublishCommand extends Command {
9090
this.logger.verbose("session", npmSession);
9191
this.logger.verbose("user-agent", userAgent);
9292

93-
// cache to hold a one-time-password across publishes
94-
this.otpCache = { otp: this.options.otp };
95-
9693
this.conf = npmConf({
9794
lernaCommand: "publish",
9895
npmSession,
@@ -101,6 +98,9 @@ class PublishCommand extends Command {
10198
registry: this.options.registry,
10299
});
103100

101+
// cache to hold a one-time-password across publishes
102+
this.otpCache = { otp: this.conf.get("otp") };
103+
104104
this.conf.set("user-agent", userAgent, "cli");
105105

106106
if (this.conf.get("registry") === "https://registry.yarnpkg.com") {

0 commit comments

Comments
 (0)