diff options
| author | Paul Buetow <paul@buetow.org> | 2025-02-26 15:24:33 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-02-26 15:24:33 +0200 |
| commit | 547afd8c0921a7de16f0a5ce8b5d8d09bb2268c8 (patch) | |
| tree | 8490aee787d4c6f9b3e025b67d888a5367def91e /internal/platforms/linkedin/oauth2 | |
| parent | e735b56a704b7328e7e84def46fd6d248c51e38d (diff) | |
introduce run interval
Diffstat (limited to 'internal/platforms/linkedin/oauth2')
| -rw-r--r-- | internal/platforms/linkedin/oauth2/oauth2.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/internal/platforms/linkedin/oauth2/oauth2.go b/internal/platforms/linkedin/oauth2/oauth2.go index dfaad19..8fe25ab 100644 --- a/internal/platforms/linkedin/oauth2/oauth2.go +++ b/internal/platforms/linkedin/oauth2/oauth2.go @@ -91,15 +91,15 @@ func oauthCallbackHandler(w http.ResponseWriter, r *http.Request) { } func LinkedInCreds(ctx context.Context, args config.Args) (string, string, error) { - secrets := args.Secrets - if secrets.LinkedInAccessToken != "" && secrets.LinkedInPersonID != "" { - return secrets.LinkedInPersonID, secrets.LinkedInAccessToken, nil + conf := args.Config + if conf.LinkedInAccessToken != "" && conf.LinkedInPersonID != "" { + return conf.LinkedInPersonID, conf.LinkedInAccessToken, nil } oauthConfig = &oauth2.Config{ - ClientID: secrets.LinkedInClientID, - ClientSecret: secrets.LinkedInSecret, - RedirectURL: secrets.LinkedInRedirectURL, + ClientID: conf.LinkedInClientID, + ClientSecret: conf.LinkedInSecret, + RedirectURL: conf.LinkedInRedirectURL, Scopes: []string{"openid", "profile", "w_member_social"}, Endpoint: linkedin.Endpoint, } @@ -133,9 +133,9 @@ func LinkedInCreds(ctx context.Context, args config.Args) (string, string, error return "", "", errs } - secrets.LinkedInAccessToken = oauthAccessToken - secrets.LinkedInPersonID = oauthPersonID - return oauthPersonID, oauthAccessToken, secrets.WriteToDisk(args.SecretsConfigPath) + conf.LinkedInAccessToken = oauthAccessToken + conf.LinkedInPersonID = oauthPersonID + return oauthPersonID, oauthAccessToken, conf.WriteToDisk(args.ConfigPath) } func openURLInFirefox(browser, url string) error { |
