That behaviour reminds me a lot of my own dog.
Nina also waits for me to shower next to the bathroom door and doesn't like at all to be left alone.
We avoid to do that, but sometimes it's just needed. But she's learning. She used to pee on the wrong place when we left her byherself at home for a little while, but now she's not doing so much of that anymore.