--- title: "Enable Custom User Validation" url: https://docs.catalyst.zoho.com/en/tutorials/birthday-greetings/nodejs/enable-custom-logic/ description: "Build a birthday greetings application using the Job Scheduling service and automatically send out birthday greetings to the required person via their email." last_updated: 2026-08-17T12:16:04Z service: All Services type: tutorial related_links: - name: "Authentication" url: /en/cloud-scale/help/authentication/introduction/ - name: "Authentication SDK" url: /en/sdk/nodejs/v2/cloud-scale/authentication/get-component-instance/ - name: "Whitelisting" url: /en/cloud-scale/help/authentication/whitelisting/introduction/ - name: "Custom User Validation" url: /en/cloud-scale/help/authentication/whitelisting/custom-user-validation/introduction/ --- # Enable Custom User Validation ### Code Your Custom Authentication Logic Now, we will code our custom logic that needs to be employed when an end user tries to register to your application. The [functions directory](https://docs.catalyst.zoho.com/en/cli/v1/project-directory-structure/functions-directory/), `BirthdayGreetings/functions/basic_function/` contains: * The `index.js` main function file * The `catalyst-config.json` configuration file * Node modules * [`package.json`](https://docs.npmjs.com/files/package.json) and [`package-lock.json`](https://docs.npmjs.com/configuring-npm/package-lock-json.html) dependency files. You will be adding code in the `index.js` file. The function contains the following functionalities: * The end-user’s details will be provided as a JSON input to the Custom User Validation function. * The function is coded to implement a custom logic based upon which the end-user will either be authenticated or denied. > **Note:** For the purpose of this tutorial, we have coded an example logic for the Custom User Validation function where if the user's email provider is anyone other than Zylker Technology (`@zylker.com`) the end user will not be able to sign up to the application. You can either use the same or code a logic of your preference. Copy the code given below and paste it in the `index.js` file in the `BirthdayGreetings/functions/basic_function` directory of your project, and save the file. You can use any IDE of your choice to work with the application’s files. > **Note:** Please go through the code in this section to make sure you fully understand it. **index.js** ```javascript const catalyst = require('zcatalyst-sdk-node') module.exports = (context, basicIO) => { const catalystApp = catalyst.initialize(context) const requestDetails = catalystApp.userManagement().getSignupValidationRequest(basicIO) if (requestDetails) { if (requestDetails.user_details.email_id.includes('@zylker.com')) { basicIO.write(JSON.stringify({ status: 'success', user_details: { first_name: requestDetails.user_details.first_name, last_name: requestDetails.user_details.last_name, email_id: requestDetails.user_details.email_id, role_identifier: 'App User', org_id: '' } })) } else { // The user has failed authentication basicIO.write(JSON.stringify({ status: 'failure' })) } } context.close() } ``` > **Notes:** * Ensure that you change the domain name in line `6` with one that matches your requirement. * You can also use this [SDK](https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/authentication/custom-user-validation/) to code your own custom logic instead of the one implemented above. ### Deploy the Function and Configure Custom User Validation To apply this custom logic, we need to deploy this function to the console to ensure that it is available to enable the Custom User Validation option present in the console. To deploy the function, execute the following CLI command to [deploy the function component alone](https://docs.catalyst.zoho.com/en/cli/v1/deploy-resources/deploy-options/#--only-lttargetsgt) to the console. ```sh catalyst deploy --only functions ``` > **Info:** You can also alternatively choose to deploy just the Custom User Validation function using the following command: `catalyst deploy --only functions:function_name` ![catalyst_tutorials_jobscheduling_deploy_only_func](https://catalyst-docs-development.zohostratus.in/images/tutorials/birthday-greetings/catalyst_tutorials_jobscheduling_deploy_only_func.webp) Function endpoints will be created for all of the functions. This will allow you to access the functions directly. The functions will be deployed to the console. They can be accessed in the console using the Functions component in the Serverless section of the console. ![catalyst_tutorials_jobscheduling_serverless_func_view](https://catalyst-docs-development.zohostratus.in/images/tutorials/birthday-greetings/catalyst_tutorials_jobscheduling_serverless_func_view.webp) > **Note:** While we have deployed all of the functions of the project to the console, we will be redeploying them once again after we code the **Advanced I/O** and **Job functions**. Now, go to the **Authentication** component present in the *Cloud Scale* section of the console and implement the following steps: 1. Navigate to the **Whitelisting** section in the *Authentication* component, and click the **Custom User Validation** toggle. ![catalyst_tutorials_jobscheduling_authentication_csu_start](https://catalyst-docs-development.zohostratus.in/images/tutorials/birthday-greetings/catalyst_tutorials_jobscheduling_authentication_csu_start.webp) 2. Select the **Basic I/O** function from the drop-down in the pop-up. ![catalyst_tutorials_jobscheduling_authentication_csu_func_sel](https://catalyst-docs-development.zohostratus.in/images/tutorials/birthday-greetings/catalyst_tutorials_jobscheduling_authentication_csu_func_sel.webp) 3. Click **Configure**. ![catalyst_tutorials_jobscheduling_authentication_csu_cmpltd](https://catalyst-docs-development.zohostratus.in/images/tutorials/birthday-greetings/catalyst_tutorials_jobscheduling_authentication_csu_cmpltd.webp) The Custom User Validation function has been enabled for the project, and the end-users signing up for your application will now be additionally authenticated using this function. > **Note:** You can find out about all of the features present in the Whitelisting section form in this [help document](https://docs.catalyst.zoho.com/en/cloud-scale/help/authentication/whitelisting/introduction/).