Use a random state

This commit is contained in:
Peter Stuifzand 2018-06-27 21:16:40 +02:00
parent fab53a1b4d
commit 59d60fcfab

View File

@ -9,6 +9,7 @@ import (
"net/http"
"net/url"
"github.com/pstuifzand/ekster/pkg/util"
"willnorris.com/go/microformats"
)
@ -70,7 +71,7 @@ func Authorize(me *url.URL, endpoints Endpoints, clientID, scope string) (TokenR
local := ln.Addr().String()
redirectURI := fmt.Sprintf("http://%s/", local)
state := "12345344"
state := util.RandStringBytes(16)
q := authURL.Query()
q.Add("response_type", "code")