how to prioritise domain used to save password for app

I've an app which uses associated domains capability to enable universal links and password saving. Both features are working, except for one tiny detail.

There are two domains associated with the app. Primary domain is the one commonly used to access the web app and the secondary domain is added due to historic reasons and handling universal links to older domain. When user sign in to the app using username and password it always gets saved against the secondary domain name and not the primary one. I tried changing the order in which the domains are defined in the entitlements file but no joy. I even tried adding webcredentials key to ASA file under both domains and that didn't work as well. Is there a way to direct iOS to prefer one domain over the other so that credential gets saved against the primary domain?