FusionAuth/go-client

Refresh tokens arent being retrieved

Closed this issue · 1 comments

Maybe I am doing something wrong but this function doesn't seem to be working. I cant seem to make it work with the API key sent which I think this function below is trying to do.

https://fusionauth.io/docs/v1/tech/apis/jwt#retrieve-refresh-tokens

// RetrieveRefreshTokens
// Retrieves the refresh tokens that belong to the user with the given Id.
//   string userId The Id of the user.
func (c *FusionAuthClient) RetrieveRefreshTokens(userId string) (*RefreshResponse, *Errors, error) {
    var resp RefreshResponse
    var errors Errors

    restClient := c.Start(&resp, &errors)
    err := restClient.WithUri("/api/jwt/refresh").
             WithParameter("userId", userId).
             WithMethod(http.MethodGet).
             Do()
    if restClient.ErrorRef == nil {
      return &resp, nil, err
    }
    return &resp, &errors, err
}

Aaah a silly mistake, I forgot to enabled that API end point!