Extract clientID to command line client

This commit is contained in:
Peter Stuifzand 2018-06-27 21:05:25 +02:00
parent d62afd7738
commit 9e7448c53b
2 changed files with 3 additions and 3 deletions

View File

@ -109,9 +109,10 @@ func main() {
log.Fatal(err)
}
clientID := "https://p83.nl/microsub-client"
scope := "read follow mute block channels"
token, err := indieauth.Authorize(me, endpoints, scope)
token, err := indieauth.Authorize(me, endpoints, clientID, scope)
if err != nil {
log.Fatal(err)
}

View File

@ -55,7 +55,7 @@ func GetEndpoints(me *url.URL) (Endpoints, error) {
return endpoints, nil
}
func Authorize(me *url.URL, endpoints Endpoints, scope string) (TokenResponse, error) {
func Authorize(me *url.URL, endpoints Endpoints, clientID, scope string) (TokenResponse, error) {
var tokenResponse TokenResponse
authURL, err := url.Parse(endpoints.AuthorizationEndpoint)
@ -68,7 +68,6 @@ func Authorize(me *url.URL, endpoints Endpoints, scope string) (TokenResponse, e
return tokenResponse, err
}
clientID := "https://p83.nl/microsub-client"
local := ln.Addr().String()
redirectURI := fmt.Sprintf("http://%s/", local)
state := "12345344"