Code cleanup and missing error checks

This commit is contained in:
Philipp Wolfer 2023-12-10 13:51:38 +01:00
parent 6eaef18188
commit c4193f42a1
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
7 changed files with 23 additions and 19 deletions

View file

@ -17,6 +17,7 @@ package auth
import (
"fmt"
"log"
"net/http"
"net/url"
@ -34,5 +35,12 @@ func RunOauth2CallbackServer(redirectURL url.URL, param string, responseChan cha
}
})
go http.ListenAndServe(redirectURL.Host, nil)
go runServer(redirectURL.Host)
}
func runServer(addr string) {
err := http.ListenAndServe(addr, nil)
if err != nil {
log.Fatal(err)
}
}