Login, authentication and security improvements