Closed Stvad closed 3 years ago
yep, explicitly awaiting on the login helped
@Stvad oh yes, the API methods are async methods. happy you were able to sort it out. I'll update the examples and will redeploy the package to npm.
@omerdn1 the fact that the api methods are async is not the issue. it's that the login that is called from the constructor is. and api's don't await on login completing. so if you just create a client and try to call an api - you get unauthorized.
So in my fork I made login public and explicitly await it before using the client - https://github.com/Stvad/otter.ai-api/commit/83b3e1c17088394d4d4b1ac185f5de569ca173b7
@Stvad Fixed in https://github.com/omerdn1/otter.ai-api/commit/6feeb79e59c528f86ede4621d47f4b35eec081a4
Thanks again for bringing this to my attention.
Thank you, @omerdn1 !
I've been trying to use the basic example from the readme, and getting an Unauthorized error :(
looking at the code it seems login is happening async, so if I just try to create client and use it breaks.. let me play with that