[Feature]: authWithOAuth2 support AbortSignal
Please don't open issues without description. Could you elaborate what is your use case?
If you are trying to cancel a pending authWithOAuth2() call I guess we can introduce a requestKey support similar to the other SDK methods, which will allow cancelling with pb.cancelRequest(requestKey).
The problem with the "all-in-one" authWithOAuth2() call is that it performs 3 different requests - listAuthMethods, start a realtime subscription and finally call to the authWithOAuth2Code() method. It is doable but requires some more thinking to structure it properly.
I have found requestKey, but I feel it is not a good interface for javascript, I like use js native cancel signal AbortSignal more
That’s a bit of a digression, now typescript support using, we can refactor cleanup code.
I would love to contribute, but my code format is diffrent with you, maybe upload .editorconfig file is good idea
Under the hood the builtin request cancellation is managed via AbortController instances.
There are no plans for now to pass AbortController/AbortController.signal as argument because it will be inconsistent with the other APIs and the internal implementation may change in the future.
As mentioned earlier, I'll consider supporting passing requestKey to the "all-in-one" authWithOAuth2() method but I'll have to think a little more on it and for now remains a low priority.
Thanks for your reply, I had implement it by myself, so it will not block me.
requestKey is fine, but it need export cancelRequestKey function, let user can muanal control cancel it
Support for cancelling the OAuth2 flow using requestKey is added in v0.21.4 release.