diff options
| -rw-r--r-- | internal/platforms/linkedin/linkedin.go | 7 | ||||
| -rw-r--r-- | internal/version.go | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/internal/platforms/linkedin/linkedin.go b/internal/platforms/linkedin/linkedin.go index ced242a..a9a6fef 100644 --- a/internal/platforms/linkedin/linkedin.go +++ b/internal/platforms/linkedin/linkedin.go @@ -22,6 +22,11 @@ var errUnauthorized = errors.New("unauthorized access, refresh or create token?" const linkedInTimeout = 10 * time.Second +// linkedInAuthTimeout bounds the interactive browser login/consent flow when +// (re-)authenticating, so it needs to be generous enough for manual entry of +// credentials and 2FA rather than a normal API call timeout. +const linkedInAuthTimeout = 5 * time.Minute + // addCommonHeaders applies required headers and optional LinkedIn versioning. func addCommonHeaders(req *http.Request, accessToken, liVersion string) { req.Header.Set("Authorization", "Bearer "+accessToken) @@ -51,7 +56,7 @@ func post(ctx context.Context, args config.Args, sizeLimit int, en entry.Entry) timeout := linkedInTimeout if args.Config.LinkedInAccessToken == "" { // Refreshing access token requires more time due to human interaction - timeout = 1 * time.Minute + timeout = linkedInAuthTimeout } newCtx, cancel := context.WithTimeout(ctx, timeout) defer cancel() diff --git a/internal/version.go b/internal/version.go index 5e688a8..75206e1 100644 --- a/internal/version.go +++ b/internal/version.go @@ -6,7 +6,7 @@ import ( "codeberg.org/snonux/gos/internal/table" ) -const versionStr = "v1.3.0" +const versionStr = "v1.3.1" func printVersion() { table.New(). |
