We have 3 different sites.. SandA, SandB, SandC and each of them have different Login pages. How can i configure/code the "Logout" link on the page?
So if i'm on site: SandA, the href for Logout is defined like this http://localhost:4502/system/sling/logout but this is using the RootMappingServlet and taking all Logout links on all sites to the one i configured. How can i solve this?
There were several posts but they did not discuss on configuring logout urls for multi-sites
I'd be interested to learn more on writing a custom RootMappingServlet. Can you send me a brief example?
I did try to write a custom LogoutServlet, define a custom url instead of using "/system/sling/logout", and used Authenticator.logout(request, response). This method works but the problem is that the Response gets invalidated and we cannot use a custom Redirect url. Whatever is defined in the RootMappingServlet is picked to show. This works good if you have one site. But for multi-site this was not the case.
One solution that worked for me:
We can add "resource" param to "/system/sling/logout" defining the path that should load after logout. No need to write any additional code.