juliocamarero/liferay-portal — pull request #894 by matethurzo (2012-12-06 21:36:16+00:00)
Title: LPS-31363 AutoLogin changes part 2

Hey Julio,

This PR contains the changes for the AutoLogin.

In this changeset, there are some new methods:

- login (was already in the infrastructure) - doLogin (new one)
- handleException (new) - doHandleException (new)

the newly created BaseAutoLogin will implement the methods from the interface, the login and the handleException, and it also provides a base implementation for it.

The main advantage is that this is a clean separation for AutoLogin hook developers, this has to be implemented for a login and that has to be implemented if an error occurs, and you should implement your own error handling there. Also the base class provides a clean and simple implementation if an exception is being thrown, the hook developers don't have to take care of if it should return null in case of an exception or has to throw an exception, they just have to set a redirect parameter and the base class will decide what to do.

Also the AutoLogin implementations got cleaner and simpler.

I haven't changed the logic in the auto logins, just removed the try - catch blocks, and modified the signature appropriately.

Thanks,

Máté