Skip to content

Commit

Permalink
Improve CLI command for login mfa (#14106)
Browse files Browse the repository at this point in the history
CLI prints a warning message indicating the login request needs to get validated
  • Loading branch information
hghaf099 authored Feb 16, 2022
1 parent 02c8b5d commit d360dee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions command/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d360dee

Please sign in to comment.