Make ClientID a parameter

This commit is contained in:
Peter Stuifzand 2018-09-29 19:05:51 +02:00
parent c9290a051d
commit 045fbfead8

View File

@ -191,12 +191,10 @@ func CreateAuthorizationURL(authURL url.URL, meURL, clientID, redirectURI, state
return authURL.String() return authURL.String()
} }
func VerifyAuthCode(code, redirectURI, authEndpoint string) (bool, *AuthResponse, error) { func VerifyAuthCode(clientID, code, redirectURI, authEndpoint string) (bool, *AuthResponse, error) {
const ClientID = "https://p83.nl/track-me"
reqData := url.Values{} reqData := url.Values{}
reqData.Set("code", code) reqData.Set("code", code)
reqData.Set("client_id", ClientID) reqData.Set("client_id", clientID)
reqData.Set("redirect_uri", redirectURI) reqData.Set("redirect_uri", redirectURI)
req, err := http.NewRequest(http.MethodPost, authEndpoint, strings.NewReader(reqData.Encode())) req, err := http.NewRequest(http.MethodPost, authEndpoint, strings.NewReader(reqData.Encode()))