feat(api): defer account creation until Garmin actually connects

This commit is contained in:
2026-07-26 13:30:51 +02:00
parent a1eaa42d42
commit 7d68af5b3c
6 changed files with 457 additions and 40 deletions

View File

@@ -19,6 +19,7 @@ type Client struct {
authResultCursor int
ClosedCalled bool
GetActivitiesCalls int
AuthenticateCalls int
LastEmail string
LastPassword string
}
@@ -35,6 +36,7 @@ func (c *Client) nextAuthResult() garmin.AuthResult {
}
func (c *Client) Authenticate(ctx context.Context) (garmin.AuthResult, error) {
c.AuthenticateCalls++
if c.Err != nil {
return garmin.AuthResult{}, c.Err
}