adds authentication and logout