more work on login authentication based on notes from andrei