complete sign-in and sign-out functionality