ueberdosis / hocuspocus

The CRDT Yjs WebSocket backend for conflict-free real-time collaboration in your app.
https://tiptap.dev/docs/hocuspocus/introduction
MIT License
1.22k stars 118 forks source link

Handle errors thrown by provider token function #722

Closed haines closed 11 months ago

haines commented 11 months ago

If you set token to be a function in the provider configuration, and that function throws an error, that's currently an unhandled promise rejection.

This PR handles the error by calling the permissionDeniedHandler so that the provider emits an authenticationFailed event that the user can handle.