App Builder \ Code Events

On Auth Fail and On Auth Success

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.

    Examples

    • Tracking Failed Login Attempts (On Auth Fail) : To save the attempted username for later analysis or support purposes:
      my_variables["failed_user"] = username;

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.

    Examples

    • 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"];

Love using ProcFu Guide?

Share your testimonial and let us know how ProcFu has helped you.

Share Your Testimonial

Built with ❤️ by Thaha for the Community