Go into the Xbox app (yep, on PC...), logout and log back in again. After this when you start the game it should log you in.
No idea why this works, but I read it somewhere a few weeks ago. The whole Microsoft store integration is something that really needs a lot of work. If any Xbox app or Windows, updates, my game gets nuked or the issue you've described happens.