closer to generating new tokens

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-26 00:27:15 -07:00
parent def1e8a109
commit 480768e33e
1 changed files with 11 additions and 2 deletions

13
main.go
View File

@ -42,6 +42,7 @@ var BUILDTIME string // this is passed in as an ldflag
// DNS over TLS plugin for coredns
// uses protobuf's and gRPC in pb/dns.proto
// https://github.com/coredns/coredns/tree/master/plugin/tls
// https://github.com/coredns/coredns/blob/master/pb/dns.proto
func onExit(err error) {
log.Println("Sleep for 1 second")
@ -204,6 +205,12 @@ func mainMouseClick(b *gui.ButtonMap) {
} else if (b.Action == "LOGIN") {
log.Println("\tTRIGGER LOGIN ACCOUNT")
gui.Data.State = "SEND LOGIN"
// TODO: move this into a seperate goroutine
event := pb.MakeLoginEvent()
event.Account = b.Account
prepareAndSend(event)
count := 0
for {
log.Println("\tSleep() in buttonClick() gui.Data.State =", gui.Data.State)
@ -301,7 +308,7 @@ func prepareAndSend(event *pb.Event) {
event.Username = gui.Data.Current.Username
event.Password = gui.Data.Current.Password
}
log.Println("\tpb.MakeLoginEvent() event.Token =", event.Token)
log.Println("\tmain.prepareAndSend() event.Token =", event.Token)
gorillaSendProtobuf(event)
gui.Data.State = "READ PROTOBUF"
}
@ -323,11 +330,13 @@ func watchGUI() {
event := pb.MakeGetEvent()
prepareAndSend(event)
}
/*
if (gui.Data.State == "SEND LOGIN") {
log.Println("\tTRIGGERING LOGIN")
event := pb.MakeLoginEvent()
prepareAndSend(event)
}
*/
if (gui.Data.State == "CREATE") {
log.Println("\tTRIGGERING CREATE")
event := pb.MakeAddVmEvent()
@ -337,7 +346,7 @@ func watchGUI() {
log.Println("gui.State = kill")
log.Println("gui.State = kill")
log.Println("gui.State = kill")
os.Exit(0)
onExit(nil)
}
if (gui.Data.State == "splash") {
for key, _ := range config.Accounts {