Implementing the sign in and out functionality