From 7967ccfe76aa44f50f4d0cf0c573bec64d448295 Mon Sep 17 00:00:00 2001 From: Robin Muhia Date: Fri, 19 Jul 2024 09:59:22 +0300 Subject: [PATCH] fix: authenticate with X-Bearer header --- client.go | 2 +- models.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 21705b3..7f766e3 100644 --- a/client.go +++ b/client.go @@ -212,7 +212,7 @@ func (s *client) MakeRequest(ctx context.Context, method, path string, queryPara request.Header.Set("Content-Type", "application/json") if authorised { - request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", s.accessToken)) + request.Header.Set("Authorization", fmt.Sprintf("X-Bearer %s", s.accessToken)) } if queryParams != nil { diff --git a/models.go b/models.go index 76351f6..7d86302 100644 --- a/models.go +++ b/models.go @@ -16,7 +16,7 @@ type ResultsResponse struct { } // TokenResponse is the data in the API response when logging in -// The access token is used as the bearer token when making API requests +// The access token is used as the X-bearer token when making API requests // The refresh token is used to obtain a new access token when it expires type TokenResponse struct { Refresh string `json:"refresh"`