Cleanup and better handling of reload of current path when login is successful