Hey Dingo,
I was having this same problem…
My solution was to just think of every possible case a user could mess things up and code some logic to prevent all of this. However this can get complicated very quickly, I tried it myself ;), but I must say it works now.
Another possibility might be, although I am not familiar yet with the cloud sync feature, to set a certain game sync state when on device A and to set a different state when logged in on device B. This way you can check which device has been logged in.
One thing though, I am beginning to doubt the advantage of logging a user in and out?
Because a user can still mess everything up, e.g. if a user is playing a game on device A, during the game the user can sign in on device B, this will still mess everything up right?
If this is not the case and your game can handle the above situation, I don’t really see a problem in just syncing the device first before letting the user make a new move.
Good luck!
Qwertier