Hi, @thunder12
First, the behavior you want is the behavior of a typical web application.
Azure AD and B2C redirect to a specific URL.
In this case, the general approach is to specify the URL you want to return to as a parameter, re-receive the parameter at the callback destination from Azure ADB2C, and redirect it independently.
Please refer to the following "Use a state parameter".
https://learn.microsoft.com/en-us/azure/active-directory/develop/reply-url#use-a-state-parameter
The application can then use the value in the state parameter to determine which URL to further send the user to. Make sure you validate for CSRF protection.