Hasura suggested developers to use serverless functions as event triggers. The way how event triggers work is, when an event is emitted, a specific serverless function will be called. However, even though Hasura deals with authentication & authorisation, serverless functions do not.
My solutions are:
- Validate the user from serverless functions (using the given session variables sent from Hasura).
- Restrict the access to serverless functions (only Hasura API can access). Something like cors.
Any thoughts of which one is the best? I personally think that the second one is the best, but don't really know it can be done.