Alternative Options to Overriding the Login Page - Layout, Look & Feel Only

I am looking for a cleaner option to override the login page layout, and look and feel. Currently the approach we are using:

  1. Create a LoginPageRequestMapper which overrides calls to referenceapplication/login to a custommodule/login

  2. Copy the contents of the LoginController to the controller of the custom page

  3. Copy the login.gsp to the custom module and override the look and feel

However this has the drawback in that any changes to the login functionality for reference application are not cascaded to the custom module. Since the Reference Application LoginController is has a request mapping to /login.htm this cannot be overridden.

When you copy the contents of LoginController, do you make any changes to them? When you copy the contents of login.gsp, do you make any changes to them?

  1. In the LoginController I remove the mapping to login.htm since two controllers cannot be mapped to the same url. Extending the ReferenceApplication controller also does not work (which was the first option I tried)

  2. The login.gsp page is where cosmetic changes are applied.

Should we just put extension points on the login page such that you do not have to do any of the above copying? For i envision a number of distributions which would want to use the referenceapplication module as it is and only change some styling, logos, and a few other things.

@dkayiwa taking from @mogoodrich has said, I think its best to remove all functionality from the referenceapplication module so here are my thoughts:

  1. Move the Login functionality and the home dashboard to coreapps (seems like that is the best place)

  2. Is there away to have a GP property for a login page - defaults to coreapps login page but I should be able to provide my own without having to override anything - just changing a variable

  3. Define a GP for the home dashboard - defaults to a coreapps one (and Reference App can override it)

@ssmusoke your problem will still not be solved by simply moving the login functionality to coreapps. You would still come back with the same post as this. :slight_smile:

That being said, am not against removing reusable functionality from the referenceapplication module. My point is, regardless of the module where this is, whenever we find people starting to copy and paste to reuse certain functionality, it is time to revisit our design and architecture in regards to those parts, in the sense of the Agile Continuous Improvement.

I do think it makes sense to move re-usable components out of the reference application and into another module (eg. coreapps). And then these should either be able to be instantiated as-is via configuration, or overridden and extended by a distribution module.

My preference (and I I think @darius and others have written the same) would be to enable and configure these for a particular distribution via json as an app config (or similar) rather than as global properties. This would, for example, enable customizing the logo for the login page, and the successUrl for logging in, as well as the layout and configuration of a home page.

Mike

@c.antwi @mozzy Here is a great feature that would add value to implementations who are leveraging Reference Application - ability to customize the login page without having to override the LoginController

See discussion for more details on the approach

1 Like

@ssmusoke That would be a great feature, and i like that. Do you think this can be made ready by the time of the release??. ofcourse it would mean work on this should be done latest july for it to be included in reff-app 2.10. Otherwise , its a wonderful feature.cc @c.antwi