Updated code with adaptation to the current changes of Reactjs.
Correct event issue parameter passing on publish.
Place all logic to proceed event after login.
Make code even more modular.