How to Customize Error Message Returned to Application Callback Endpoint
Last Updated:
Overview
https://yourdomain/callback?error=unauthorized&error_description=user%20is%20blocked&state=state
How can the application catch this error message and other errors that get sent in this format to the application's callback endpoint?
Solution
const urlParams = new URLSearchParams(window.location.search);
const errorDescription = urlParams.get('error_description');
if (errorDescription === 'user is blocked') {
// then render a custom message e.g. 'You are blocked. Please contact support'
}