From 343836597df3efd6f31a68e29ff82b6ec4979f69 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Fri, 18 Mar 2022 10:45:10 +0100 Subject: Move HTTP GET/POST methods to its own file --- cli/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/main.go b/cli/main.go index c3b6258..42c4b67 100644 --- a/cli/main.go +++ b/cli/main.go @@ -14,6 +14,10 @@ func openBrowser(urlString string) { exec.Command("xdg-open", urlString).Start() } +func logState(oldState string, newState string) { + log.Printf("State: %s -> State: %s\n", oldState, newState) +} + func main() { urlArg := flag.String("url", "", "The url of the vpn") flag.Parse() @@ -30,7 +34,7 @@ func main() { state := eduvpn.GetVPNState() - eduvpn.Register(state, "org.eduvpn.app.linux", urlString) + eduvpn.Register(state, "org.eduvpn.app.linux", urlString, logState) authURL, err := eduvpn.InitializeOAuth(state) if err != nil { log.Fatal(err) -- cgit v1.2.3