implemented auth and logout (Closes #3)