Tried to add some mutli-tenant login logic to the login operation through the
hook, but I noticed that the hook isn't called in the login operation code, but
are. Perhaps the
hook would be useful in my case though, as I want to prevent the login under certain conditions. It is to late to do so in the
hook, and the
hook doesn't give me the user document.
i think we ended up removing beforeLogin as it was in the same position as the beforeOperation hook. What would you need to modify in this new hook? User? Token? Cookie?
I have a PR incoming 🙂 although, I realized I might simply be able to throw an error in the
hook to reject a login operation.
Doing some more testing
Simply throwing did the trick.
I updated the docs and types in a PR though:
Token is set before the
hook is called, so I'll create a PR where I bring back the
@dsod we will review this today!