Skip to content

Commit cc96e98

Browse files
committed
Fixed token source client
1 parent 132236e commit cc96e98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/iot/token.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ func NewUserTokenSource(client, secret, baseURL string) oauth2.TokenSource {
5858

5959
func ctxWithToken(ctx context.Context, src oauth2.TokenSource) (context.Context, error) {
6060
// Retrieve a valid token from the src.
61-
tok, err := src.Token()
61+
_, err := src.Token()
6262
if err != nil {
6363
if strings.Contains(err.Error(), "401") {
6464
return nil, errors.New("wrong credentials")
6565
}
6666
return nil, fmt.Errorf("cannot retrieve a valid token: %w", err)
6767
}
68-
return context.WithValue(ctx, iotclient.ContextOAuth2, tok.AccessToken), nil
68+
return context.WithValue(ctx, iotclient.ContextOAuth2, src), nil
6969
}

0 commit comments

Comments
 (0)