Skip to content

Commit ab82c5c

Browse files
committed
Retrieve token before setting ticker to avoid initial delay
1 parent 65c15a3 commit ab82c5c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

deviceauth.go

+5
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ func (c *Config) DeviceAccessToken(ctx context.Context, da *DeviceAuthResponse,
157157
opt.setValue(v)
158158
}
159159

160+
tok, err := retrieveToken(ctx, c, v)
161+
if err == nil {
162+
return tok, nil
163+
}
164+
160165
// "If no value is provided, clients MUST use 5 as the default."
161166
// https://datatracker.ietf.org/doc/html/rfc8628#section-3.2
162167
interval := da.Interval

0 commit comments

Comments
 (0)