diff options
| author | Paul Buetow <paul@buetow.org> | 2024-10-09 11:25:49 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-10-09 11:25:49 +0300 |
| commit | 6622cc6402df56dd416e3ca3894d5b208fa26077 (patch) | |
| tree | d49582c4bb2216000b01ea7d8eb2ef37ba784977 /internal/config | |
| parent | fba8665dcc22d11f8ac7b7583701951dc4d9544f (diff) | |
can re-use access token for linkedin oauth
Diffstat (limited to 'internal/config')
| -rw-r--r-- | internal/config/args.go | 1 | ||||
| -rw-r--r-- | internal/config/secrets.go | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/internal/config/args.go b/internal/config/args.go index 601a2d1..3bfa78e 100644 --- a/internal/config/args.go +++ b/internal/config/args.go @@ -17,6 +17,7 @@ type Args struct { Lookback time.Duration SecretsConfigPath string Secrets Secrets + OAuth2Browser string } func (a Args) Validate() error { diff --git a/internal/config/secrets.go b/internal/config/secrets.go index dc3f8e7..6ed1c1f 100644 --- a/internal/config/secrets.go +++ b/internal/config/secrets.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "io" + "log" "os" ) @@ -15,9 +16,9 @@ type Secrets struct { LinkedInSecret string LinkedInRedirectURL string // Will be updated by gos automatically, after successful oauth2 - LinkedInAccessToken string `json:"LinedInAccessToken,omitempty"` + LinkedInAccessToken string `json:"LinkedInAccessToken,omitempty"` // Will be updated by gos automatically, after successful oauth2 - LinkedInPersonID string `json:"LinedInPersonID,omitempty"` + LinkedInPersonID string `json:"LinkedInPersonID,omitempty"` } func NewSecrets(configPath string) (Secrets, error) { @@ -41,6 +42,8 @@ func NewSecrets(configPath string) (Secrets, error) { } func (s Secrets) WriteToDisk(configPath string) error { + log.Println("Writing", configPath) + bytes, err := json.MarshalIndent(s, "", " ") if err != nil { return fmt.Errorf("failed to marshal JSON: %w", err) |
