
justin_at_adobe wrote...
Hi,
The Login Selector Authentication Handler allows you to specify a different login page based on the content path. It sounds like this isn't what you are trying to do. Instead, you want to redirect the user to a different location after login.
One way to do this is to pass a request parameter named resource with the path you want to redirect after login.
Another way is to handle the login in AJAX and then do the redirect manually. If you want to use the approach (which it sounds like you do), be sure to pass the j_validate parameter. See http://sling.apache.org/documentation/the-sling-engine/authentication/authentication-authenticationhandler/form-based-authenticationhandler.html
Regards,
Justin
Hi Justin,
You are right. I am trying to use the second approach. I had passed j_validate true already and login is happening fine. My login is a lightbox and i do an Ajax call within the lightbox. On success for most cases i have to refresh the page so i was trying to refresh using window.location.reload() event. The login returns success and after this line is executed, i get UserName or password not valid on the page but the user is still logged in. In one or two use case i have to redirect the user back to the page they were accessing before they were asked to login.
Any ideas or pointers would be appreciated.
Thanks.