App Builder \ Code Events
On Auth Fail and On Auth Success

Thaha
App Builder & Automation Expert
Stay Updated with ProcFu!
Subscribe to our newsletter for the latest tips, updates, and automation insights.
Subscribe Now
-->
On Auth Fail
- The "On Auth Fail" event is specifically designed to handle situations where a user attempts to log in with incorrect credentials. It provides a strategic point for implementing custom logic in response to failed authentication attempts.
- This is a server-side event and utilize ProcScript, providing access to the entire Functions API library.
- The following variables are available in the On Auth Fail event:
location
: Returns the current URL. Changing this value redirects the page to the new URL.my_variables
: Enables access to previously set variables and allows setting new ones.custom_tokens
: Access and set custom tokens here.username
: The username used in the failed login attempt.- Tracking Failed Login Attempts (On Auth Fail) : To save the attempted username for
later analysis or support purposes:
my_variables["failed_user"] = username;
Examples
On Auth Success
- The "On Auth Success" event is triggered when a user successfully logs in, marking a successful authentication process.
- This is a server-side event and utilize ProcScript, providing access to the entire Functions API library.
- The following variables are available in the On Auth Success event:
location
: Returns the current URL. Changing this value redirects the page to the new URL.my_variables
: Enables access to previously set variables and allows setting new ones.custom_tokens
: Access and set custom tokens here.auth_item
: Returns the authenticated user's item as raw JSON, including values, config, etc.auth_item_values
: Isolates just the data values from the "auth_item", omitting configuration details and other metadata.username
: The username used in the successful login attempt.- Storing User Role for Subsequent Use (On Auth Success) : If you want to capture and
save the logged-in user’s role for later use (assuming there's a field called “role” on the user
record):
my_variables["user_role"] = auth_item_values["role"];