summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-10-08 11:32:37 +0300
committerPaul Buetow <paul@buetow.org>2024-10-08 11:32:37 +0300
commitfba8665dcc22d11f8ac7b7583701951dc4d9544f (patch)
tree2a98705b6324124d545ea43a2855bb36d1a75cfa
parent8e30ad597bf200c2f3be22262364a6f4e1af1a36 (diff)
fix
-rw-r--r--internal/platforms/linkedin/linkedin.go2
-rw-r--r--internal/platforms/linkedin/oauth2/oauth2.go6
2 files changed, 4 insertions, 4 deletions
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
}