Creating a login/logout function for the communities page