Skip to content

Commit

Permalink
fix: login (#843)
Browse files Browse the repository at this point in the history
  • Loading branch information
raulb authored Oct 27, 2023
1 parent cfb284f commit 7bf0bd8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cmd/meroxa/global/basic_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,15 @@ func (r *client) newRequest(
req.Header = r.headers
}

accessToken, _, err := GetUserToken()
if err != nil {
return nil, err
// No need to check for a valid token when trying to authenticate.
// TODO: Need to change this once we integrate with OAuth2
if path != "/api/collections/users/auth-with-password" {
accessToken, _, err := GetUserToken()
if err != nil {
return nil, err
}
req.Header.Add("Authorization", accessToken)
}
req.Header.Add("Authorization", accessToken)
req.Header.Add("Content-Type", jsonContentType)
req.Header.Add("Accept", jsonContentType)
req.Header.Add("User-Agent", r.userAgent)
Expand Down

0 comments on commit 7bf0bd8

Please sign in to comment.