From 9e7448c53bb71bc4b20a96fcd9daa487b7accd0a Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Wed, 27 Jun 2018 21:05:25 +0200 Subject: [PATCH] Extract clientID to command line client --- cmd/ek/main.go | 3 ++- pkg/indieauth/auth.go | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/ek/main.go b/cmd/ek/main.go index d7dbe81..277464f 100644 --- a/cmd/ek/main.go +++ b/cmd/ek/main.go @@ -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) } diff --git a/pkg/indieauth/auth.go b/pkg/indieauth/auth.go index fba3584..c907945 100644 --- a/pkg/indieauth/auth.go +++ b/pkg/indieauth/auth.go @@ -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"