From d360deecdd0c8c6fc0344a7349eda85c2ecb892d Mon Sep 17 00:00:00 2001 From: hghaf099 <83242695+hghaf099@users.noreply.github.com> Date: Wed, 16 Feb 2022 14:52:08 -0500 Subject: [PATCH] Improve CLI command for login mfa (#14106) CLI prints a warning message indicating the login request needs to get validated --- command/write.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/command/write.go b/command/write.go index dd0d7cfde99e..0643d8c65314 100644 --- a/command/write.go +++ b/command/write.go @@ -146,6 +146,11 @@ func (c *WriteCommand) Run(args []string) int { return 0 } + if secret != nil && secret.Auth != nil && secret.Auth.MFARequirement != nil { + c.UI.Warn(wrapAtLength("WARNING! A login request was issued that is subject to "+ + "MFA validation. Please make sure to validate the login by sending another "+ + "request to mfa/validate endpoint.") + "\n") + } // Handle single field output if c.flagField != "" { return PrintRawField(c.UI, secret, c.flagField)