-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation for BeforeRequest #62
Comments
We don't have documentation for both BeforeRequest and On AfterCommit.
We could also add a 'Security in Deployd' section and point to all the documents that are related to. As this is a standard terminology, will make it easier for quick reference. Here is the documentation for BeforeRequest and AfterCommit. Pl. suggest your corrections and will add it to a new Help page ""Collection Events". ON BEFOREREQUEST
Note: This above code applies for all four events. If your API doesn't need login for post or get , etc. You have to add this in each event. You can also find open source modules in "modules link" for 'Security' modules to include in your project. ON AFTERCOMMIT Called after a POST / PUT / DELETE event is executed. You can use event for example, changing return values or sending out emails etc. |
It's important to add that 'BeforeRequest' exposes a variable to scripts named And AfterCommit has a similar |
That is beautiful . Awesome. I think we should directly start editing in the Documents repo. if (!me) cancel("Not authorized", 401); // don't allow anyone in that is not authorized switch (event) { |
AfterCommit runs after the database has been updated and after a response has been returned. It's main purpose is to run code after ensuring that data has been stored. Use it to Assuming data has been commited prior to AfterCommit is a strongly discouraged. We should change the other places in the documentation that recommend running |
deployd/deployd#596
The text was updated successfully, but these errors were encountered: