Skip to content

Commit

Permalink
store access token (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoeg authored Jan 19, 2024
1 parent 32f609b commit edac9e7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/http/authenticator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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
}
Expand Down

0 comments on commit edac9e7

Please sign in to comment.