Make ClientID a parameter
This commit is contained in:
parent
c9290a051d
commit
045fbfead8
6
auth.go
6
auth.go
|
@ -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()))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user