complete sign in and out functionality