Hi Sam,
The customization made to any of the web pages will not be retained during upgrade/patching. In general, it is not recommended to customize web page unless it is documented and supported. Please check if there is any possibility of making the domain as default in directory so that users can just enter username in UI.