Many times when we customize the AEM login page we hardcode runmodes. Even though this gets the job done, there is a better way to do it using OSGi configs and Sling. The steps are as follows:
1) Create a service that takes OSGi configurations.
2) Create the required OSGi config nodes under the required runmodes.
3) Call the service from your login.jsp
To find out details please see my latest blog post here.
Hope you find this useful!