Detach the command to open the url so the http server can start

This commit is contained in:
lordwelch 2020-08-07 14:11:33 -07:00
parent 81f4ab46c7
commit dd6ec82cba

View File

@ -203,7 +203,7 @@ func (p ProviderConfig) Authenticate(t *OAuth2Token) error {
})
// Filter the commands, and replace "{}" with our callback url
c := p.AgentCommand[:0]
c := make([]string, 0, len(p.AgentCommand))
replacedURL := false
for _, arg := range p.AgentCommand {
if arg == "{}" {
@ -219,7 +219,8 @@ func (p ProviderConfig) Authenticate(t *OAuth2Token) error {
//TODO Drop privileges
cmd := exec.Command(c[0], c[1:]...)
cmd.Run()
cmd.Start()
cmd.Process.Release()
server := &http.Server{}
go func() {