From cb38f62ea7fe65732180805a1555bf969e9394ee Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 4 Oct 2024 23:17:10 +0300 Subject: add more todos --- internal/platforms/linkedin/oauth2.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'internal') diff --git a/internal/platforms/linkedin/oauth2.go b/internal/platforms/linkedin/oauth2.go index abd6164..0492059 100644 --- a/internal/platforms/linkedin/oauth2.go +++ b/internal/platforms/linkedin/oauth2.go @@ -124,13 +124,16 @@ func oauthCallbackHandler(w http.ResponseWriter, r *http.Request) { _, _ = w.Write([]byte("Successfully posted a message to LinkedIn!\n")) } +// TODO: Check for how logn the access token is valid for +// TODO: Fetch the access token and user ID and store it i na file in .config/gos/... +// TODO: Refresh access token when it is about to expire or expired +// TODO: Separate posting of the message and fetching of the userID and access token func oauth(args config.Args) error { - // Configure the OAuth2 client oauthConfig = &oauth2.Config{ ClientID: args.Secrets.LinkedInClientID, ClientSecret: args.Secrets.LinkedInSecret, RedirectURL: args.Secrets.LinkedInRedirectURL, - Scopes: []string{"profile", "openid", "w_member_social"}, + Scopes: []string{"openid", "profile", "w_member_social"}, Endpoint: linkedin.Endpoint, } -- cgit v1.2.3