Skip to content
Snippets Groups Projects
Commit 3fda2211 authored by Kevin Lyda's avatar Kevin Lyda :speech_balloon:
Browse files

Always send auto_token.

parent 915de781
Branches
No related tags found
No related merge requests found
......@@ -207,8 +207,8 @@ func StartHTTPServer() *Listener {
go func() {
err := listener.srv.Serve(l)
if err == http.ErrServerClosed {
fmt.Printf("Httpserver: Server() error: %s", err)
if err != http.ErrServerClosed {
fmt.Printf("Httpserver: Server() error: %s\n", err)
}
return
}()
......
......@@ -49,14 +49,15 @@ func main() {
if err != nil {
log.Fatalln("Error generating key pair: ", err)
}
authURL := c.CA
listener := &client.Listener{}
port := 0
if c.AutoToken {
listener = client.StartHTTPServer()
if listener != nil {
authURL = fmt.Sprintf("%s?auto_token=%d", c.CA, listener.Port)
port = listener.Port
}
}
authURL := fmt.Sprintf("%s?auto_token=%d", c.CA, port)
fmt.Printf("Your browser has been opened to visit %s\n", authURL)
if err := browser.OpenURL(authURL); err != nil {
fmt.Println("Error launching web browser. Go to the link in your web browser")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment