implenented auth and login; with tests.