Skip to content

Commit

Permalink
Allow password to be saved to keychain with skip-prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
casperbiering committed Sep 8, 2021
1 parent f3d590d commit 52875ed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/saml2aws/commands/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ func Configure(configFlags *flags.CommonFlags) error {
if err != nil {
return errors.Wrap(err, "failed to input configuration")
}
}

if credentials.SupportsStorage() {
if err := storeCredentials(configFlags, account); err != nil {
return err
}
if credentials.SupportsStorage() {
if err := storeCredentials(configFlags, account); err != nil {
return err
}
}

Expand All @@ -71,7 +71,7 @@ func storeCredentials(configFlags *flags.CommonFlags, account *cfg.IDPAccount) e
if err := credentials.SaveCredentials(account.URL, account.Username, configFlags.Password); err != nil {
return errors.Wrap(err, "error storing password in keychain")
}
} else {
} else if !configFlags.SkipPrompt {
password := prompter.Password("Password")
if password != "" {
if confirmPassword := prompter.Password("Confirm"); confirmPassword == password {
Expand Down

0 comments on commit 52875ed

Please sign in to comment.