mirror of
https://github.com/getsops/sotp.git
synced 2026-02-05 09:45:59 +01:00
fix logging
This commit is contained in:
6
main.go
6
main.go
@@ -31,19 +31,17 @@ func main() {
|
||||
}
|
||||
cfg, err := decryptConfig("config.yaml")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
log.Fatal("failed to access configuration at 'config.yaml'", err)
|
||||
}
|
||||
var totpSecret string
|
||||
for _, account := range cfg.Accounts {
|
||||
if account.Name == os.Args[1] {
|
||||
totpSecret = account.TOTPSecret
|
||||
}
|
||||
if totpSecret != "" {
|
||||
break
|
||||
}
|
||||
}
|
||||
if totpSecret == "" {
|
||||
fmt.Println("no totp information found for account", os.Args[1])
|
||||
log.Fatal("no totp information found for account", os.Args[1])
|
||||
}
|
||||
otp := gotp.NewDefaultTOTP(totpSecret)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user