Rank 1: Thread
Hey all, in my project I needed to have different session limits per user. So with the advice of Matej, I created a collection that stores attributes userId and limit.
Then I created a function that fired on users..sessions..create
It checks if a user's session has gone over their limit. Right now if that is true, it will delete the session. The issue is I need to send the response to the client with the error message, with the idea that I can deny the login request.
I was looking through the documentation, I'm not sure how to send a message back to the client manually. I think as an API this the things like res.json({}) are supposed to be returned?
I think a workaround, if I can send any type of message to the client I could have them listen and then fire the logout() that way.
The client is using appwrite web sdk and svelte