When you make something global, you force there to only be one of it.
You say that user authentication status should be global. Then what happens later, when your customers want to be able to log in with two user accounts at once, and switch between them? You keep a backup copy of the authentication state and swap it with the real one? That's asking for bugs.
But your customers aren't asking for that yet. You do want to make an app where, for now, the customer can only log in with one account. Obviously somewhere in the app is going to be a variable for "the account". But you want that to be pushed as far out as possible. You want as much code as possible to assume there could be more than one, so that later when there is more than one, you won't need to change it. Instead of writing void RefreshAuthenticationToken()
you write void RefreshAuthenticationToken(Account* account)
. And even the "log out" button has an Account passed to it, telling it which account to log out when it's clicked on. Only the top level, that ties everything together - the Composition Root - should know there's only one account. Then, when you want more than one, you only have to change how the different parts are tied together.
Everyone knows Minecraft. Minecraft used to have this problem - there was the game world, there was just one, and everything referred to it. But then, they wanted to add an alternate game world (called "the nether") that you could travel to, by going through a portal. The solution was to put The Nether in a separate save file. Whenever the player travelled to The Nether through a portal, the game would essentially delete the player character from the game world, save and quit, load The Nether, then create a player character in The Nether with the same information it previously deleted. For obvious reasons, this doesn't work in multiplayer mode (there can be several players and each one in a different world), so multiplayer didn't support The Nether for several months. Eventually, every function that cared about the game world had a World parameter to say which world, and then both worlds could exist at the same time.
If it was written that way to begin with, the only part of the game that knew there was only one world would be the part that loaded a save file. To create The Nether would've been a lot easier, that part could've been made to load two worlds from a save file instead of just one. It would've worked in multiplayer from the beginning, too. They could've just done new World().setName("The Nether").setTerrain(new NetherTerrainGenerator()).setSkyColour(RED)
and had it all ready to go.