Documentation: onAuthenticate when token is undefined
Part of the documentation?
I’ve read the following page of the documentation: onAuthenticate
Really helpful parts The Authentication & Authorization page: https://tiptap.dev/docs/hocuspocus/guides/auth
Hard to understand, missing or misleading
Be aware, the onAuthenticate hook will only be called after the client has sent the Auth message, which won't happen if there is no token provided to HocuspocusProvider.
I am not sure I understand this fully. First, my guess is this is outdated. The current implementation of the provider provides an empty string, if the token is undefined. And if it's still not present an error is raised. So this sentence seems outdated. Also, I am not sure what this even meant. Does it mean there is no authentication if you simply leave the token undefined OR is the server canceling the request before. This would be an important differentiation.
I have tested this locally and it seems even when I fork the provider and force undefined as token, the server will call the hook with an empty string.
Additional context Glad to provide a PR which removes this sentence if this is indeed outdated / wrong information. Otherwise it would be helpful to clarify what is meant.
true! onAuthenticate is now always called. Happy to merge a PR :)