Added a generic `withAuthenticatedUser` helper that takes two callbacks (one that will be invoked when the user is logged in, and the other when the user is not logged in).