mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 05:37:05 +02:00
Code cleanup and missing error checks
This commit is contained in:
parent
6eaef18188
commit
c4193f42a1
7 changed files with 23 additions and 19 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue