diff --git a/main.go b/main.go index 7b6b056..83fc839 100644 --- a/main.go +++ b/main.go @@ -365,7 +365,24 @@ func main() { // Connect to server. client, err := connect(options, *flagDirectTLS) if err != nil { - log.Fatal(err) + if fast.Token != "" { + // Reset FAST token and mechanism if FAST login failed. + fast.Token = "" + fast.Mechanism = "" + fast.Expiry = time.Now() + err := writeFastData(user, password, fast) + if err != nil { + fmt.Println(err) + } + options.FastToken = "" + // Try to connect to server without FAST. + client, err = connect(options, *flagDirectTLS) + if err != nil { + log.Fatal(err) + } + } else { + log.Fatal(err) + } } // Store fast token if a new one is received.