How to Customize Error Message Returned to Application Callback Endpoint

Problem statement

When a user has been blocked via the Auth0 dashboard, the message is returned to the application’s callback endpoint with the error description in the URL:


How can the application catch this error message and other errors that get sent in this format to the application’s callback endpoint?


This will vary significantly depending on the application and frameworks used. However, a basic example using Javascript could look like the following:

const urlParams = new URLSearchParams(;
const errorDescription = urlParams.get('error_description');
if (errorDescription === 'user is blocked') {
   // then render a custom message e.g. 'You are blocked. Please contact support'