Closed mponizil closed 3 years ago
Hi @mponizil.
Sorry you're having some problems! Would you mind contacting us at support@cronofy.com please?
We could do with a few more details to help us find logs and build some accurate replication steps, so that will be best done through our support rather than here.
Speak to you there!
We experienced some unexpected behavior recently when using the undocumented
client.availability(...)
endpoint.Based on the source code, it appears that
bearer_token: "<client-secret>"
may be used to achieve application authentication. Unfortunately this can be problematic because requests will useconfig.access_token
instead if it's been defined. We don't initialize the client with anaccess_token
, but ultimately we realized that therefreshAccessToken
method will populateconfig.access_token
on its own.So the result is that
availability(...)
works the first time, but ifrefreshAccessToken
is used, a subsequent call toavailability(...)
may use an expired access token (or potentially one for a user that's not even involved in the availability request).This seems potentially OK since there's no documentation around passing in
bearer_token
, but I did want to clarify if there's a best practice here or anything I might be missing.access_token: "<client-secret>"
to theavailability(...)
request. Does this sound like the right approach, or would it be better to use anaccess_token
of one the users included in the request?Thank you!