adds login authentication and authorization, with some tests