Added authentication and login persistence