bbgo: improve otp key layout

This commit is contained in:
c9s 2022-01-16 23:47:26 +08:00
parent 1b06712d90
commit a3cc101c79

View File

@ -639,7 +639,7 @@ func (environ *Environment) setupInteraction(persistence service.PersistenceServ
return err return err
} }
log.Infof("otp key loaded: %+v", key) log.Infof("otp key loaded: %s", util.MaskKey(key.Secret()))
printOtpAuthGuide(otpQRCodeImagePath) printOtpAuthGuide(otpQRCodeImagePath)
} }
@ -675,7 +675,6 @@ func (environ *Environment) getAuthStore(persistence service.PersistenceService)
} }
func (environ *Environment) setupSlack(userConfig *Config, slackToken string, persistence service.PersistenceService) { func (environ *Environment) setupSlack(userConfig *Config, slackToken string, persistence service.PersistenceService) {
conf := userConfig.Notifications.Slack conf := userConfig.Notifications.Slack
if conf == nil { if conf == nil {
return return
@ -832,13 +831,13 @@ func setupNewOTPKey(qrcodeImagePath string) (*otp.Key, error) {
func printOtpKey(key *otp.Key) { func printOtpKey(key *otp.Key) {
fmt.Println("") fmt.Println("")
fmt.Println("====================PLEASE STORE YOUR OTP KEY=======================") fmt.Println("====================================================================")
fmt.Println("") fmt.Println(" PLEASE STORE YOUR OTP KEY SAFELY ")
fmt.Printf("Issuer: %s\n", key.Issuer()) fmt.Println("====================================================================")
fmt.Printf("AccountName: %s\n", key.AccountName()) fmt.Printf(" Issuer: %s\n", key.Issuer())
fmt.Printf("Secret: %s\n", key.Secret()) fmt.Printf(" AccountName: %s\n", key.AccountName())
fmt.Printf("Key URL: %s\n", key.URL()) fmt.Printf(" Secret: %s\n", key.Secret())
fmt.Println("") fmt.Printf(" Key URL: %s\n", key.URL())
fmt.Println("====================================================================") fmt.Println("====================================================================")
fmt.Println("") fmt.Println("")
} }