From edac9e7650d4f0574b1bb966afd9c695243b2c5a Mon Sep 17 00:00:00 2001 From: Peter Hoeg Steffensen Date: Fri, 19 Jan 2024 11:29:18 +0100 Subject: [PATCH] store access token (#521) --- internal/http/authenticator.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/http/authenticator.go b/internal/http/authenticator.go index 56d81618..0b5efcce 100644 --- a/internal/http/authenticator.go +++ b/internal/http/authenticator.go @@ -69,6 +69,10 @@ func (g *UserAuthenticator) Access(ctx context.Context) (*http.Client, error) { if err != nil { return nil, fmt.Errorf("auto login failed: %w: %w", ErrLoginRequired, err) } + err = storeAccessToken(token) + if err != nil { + return nil, err + } } else { return nil, fmt.Errorf("%w: %w", ErrLoginRequired, err) } @@ -78,6 +82,10 @@ func (g *UserAuthenticator) Access(ctx context.Context) (*http.Client, error) { if err != nil { return nil, fmt.Errorf("auto login failed: %w: %w", ErrLoginRequired, err) } + err = storeAccessToken(token) + if err != nil { + return nil, err + } } return g.conf.Client(ctx, token), nil }