From fba8665dcc22d11f8ac7b7583701951dc4d9544f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 8 Oct 2024 11:32:37 +0300 Subject: fix --- internal/platforms/linkedin/linkedin.go | 2 +- internal/platforms/linkedin/oauth2/oauth2.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/platforms/linkedin') diff --git a/internal/platforms/linkedin/linkedin.go b/internal/platforms/linkedin/linkedin.go index 768def5..da1ce0d 100644 --- a/internal/platforms/linkedin/linkedin.go +++ b/internal/platforms/linkedin/linkedin.go @@ -21,7 +21,7 @@ func Post(ctx context.Context, args config.Args, ent entry.Entry) error { return nil } - personID, accessToken, err := oauth2.LinkedInOauth2Creds(args) + personID, accessToken, err := oauth2.LinkedInOAuth2Creds(args) if err != err { return err } diff --git a/internal/platforms/linkedin/oauth2/oauth2.go b/internal/platforms/linkedin/oauth2/oauth2.go index 6a692b3..e800bac 100644 --- a/internal/platforms/linkedin/oauth2/oauth2.go +++ b/internal/platforms/linkedin/oauth2/oauth2.go @@ -81,7 +81,7 @@ func oauthCallbackHandler(w http.ResponseWriter, r *http.Request) { _, _ = w.Write([]byte("Successfully fetched LinkedIn person ID\n")) } -func LinkedInOauth2Creds(args config.Args) (string, string, error) { +func LinkedInOAuth2Creds(args config.Args) (string, string, error) { secrets := args.Secrets if secrets.LinkedInAccessToken != "" && secrets.LinkedInPersonID != "" { // TODO: Check, whether the access token is still valid. If not, get a new one. @@ -95,13 +95,13 @@ func LinkedInOauth2Creds(args config.Args) (string, string, error) { Scopes: []string{"openid", "profile", "w_member_social"}, Endpoint: linkedin.Endpoint, } - errCh := make(chan error) + errCh = make(chan error) http.HandleFunc("/", oauthIndexHandler) http.HandleFunc("/callback", oauthCallbackHandler) + log.Println("Listening on http://localhost:8080 for LinkedIn oauth2") go func() { - log.Println("Listening on http://localhost:8080 for LinkedIn oauth2") if err := http.ListenAndServe(":8080", nil); err != nil { errCh <- err } -- cgit v1.2.3