# Help displaying message on Universal Login after Post Login access deny check

**URL:** <https://community.auth0.com/t/help-displaying-message-on-universal-login-after-post-login-access-deny-check/193143>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [October 13, 2025, 9:47pm UTC](https://community.auth0.com/t/help-displaying-message-on-universal-login-after-post-login-access-deny-check/193143 "2025-10-13T21:47:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhicks](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jhicks/32/77005_2.png) [@jhicks](https://community.auth0.com/u/jhicks)\
**Post date:** [October 13, 2025, 9:47pm UTC](https://community.auth0.com/t/help-displaying-message-on-universal-login-after-post-login-access-deny-check/193143/1 "2025-10-13T21:47:32Z")

</div>

I have the universal login for a Salesforce experience cloud site. Users are enabled for the site in Salesforce itself, but we add a property to the user’s app\_metadata that says if they are enabled or not (true or false).

I am trying to implement a post-login action where after a user inputs their Auth0 credentials, the app\_metadata is checked and if the enabled property is false, I want the user to be redirected to the universal login with the error message of ‘You are not enabled for this site. Contact xyz’. Right now, if the user is not enabled for the site, they are redirected to a Salesforce generic page that says to contact the Salesforce Admin, thus why I want to change that to go back to the universal login with the clear message of what went wrong.

I’ve tried using the api.access.deny(‘message’) but all it seems to be doing is adding that deny message to the logs but the user is still redirected to the generic Salesforce page.

I’ve tried api.redirect.sendUserTo and it does redirect to the universal login page, but it doesn’t have any error message, the documentation doesn’t show what the ‘query options’ are.

Has anyone had a similar scenario of wanting to deny access and showing a message on the universal login? Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![gerald.czifra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.czifra/32/75301_2.png) [@gerald.czifra](https://community.auth0.com/u/gerald.czifra)\
**Post date:** [October 14, 2025, 6:45pm UTC](https://community.auth0.com/t/help-displaying-message-on-universal-login-after-post-login-access-deny-check/193143/3 "2025-10-14T18:45:14Z")

</div>

Hi @jhicks

Welcome to the Auth0 Community!

Please allow me some time to research this matter and I will be back with more information as soon as possible.

Thank you!  
Gerald

---

<div class="post-metadata">

**Author:** ![gerald.czifra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.czifra/32/75301_2.png) [@gerald.czifra](https://community.auth0.com/u/gerald.czifra)\
**Post date:** [October 16, 2025, 3:29pm UTC](https://community.auth0.com/t/help-displaying-message-on-universal-login-after-post-login-access-deny-check/193143/4 "2025-10-16T15:29:36Z")

</div>

Hi @jhicks

After doing some testing on this matter, I can confirm that your desired flow can be achieved with api.access.deny(‘message’) to first deny access to the user and then direct them to a [Custom Error Page](https://auth0.com/docs/customize/login-pages/custom-error-pages), allow me to outline why:

- [api.access.deny()](https://auth0.com/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/post-login-api-object#:~:text=api.access.deny(reason)) will terminate the authentication flow, therefore anything added after it will not get triggered;
- once the authorization error occurs and if you do not have a valid callback URL, your application will [display the default generic Auth0 error page](https://auth0.com/docs/authenticate/login/auth0-universal-login/error-pages#:~:text=application%20will%20display-,the%20default%20generic%20Auth0%20error%20page.%20Alternatively%2C%20you%20can%20customize%20the,.,-To%20find%20the), or a custom error page if you set it up, that can also contain a redirect button;
- using [api.redirect.sendUserTo](https://auth0.com/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/redirect-with-actions#:~:text=Call%20the%20api.redirect.sendUserTo()%20function%20as%20follows%3A) is a great idea, but it cannot be accessed due to the above after calling api.access.deny().

One way to complete these actions in sequence ( first denying the user’s access with an error message, then redirecting them) can be done by setting up a Custom Error Page where you will redirect the users to after denying them access, that is setup to display an error message and have a button to redirect the user once pressed.

I recommend taking a look at the following topics and documentations, as some approaches mentioned can assist with creating a flow that suits your needs:

- [Redirect user back to login page with error message displayed - #3 by richard.hart](https://community.auth0.com/t/redirect-user-back-to-login-page-with-error-message-displayed/112637/3)
- [Deny PLUS redirect in Action Triggers - #2 by sumansaurav](https://community.auth0.com/t/deny-plus-redirect-in-action-triggers/170287/2)
- [Cannot Get Back to Login Screen After an Action Denies Access](https://support.auth0.com/center/s/article/Cannot-get-back-to-login-screen-after-getting-denied-by-post-login-action)

Hope this helped!  
Gerald

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 30, 2025, 3:30pm UTC](https://community.auth0.com/t/help-displaying-message-on-universal-login-after-post-login-access-deny-check/193143/5 "2025-10-30T15:30:19Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
