I have added a warning pop-up when a user logs out in our offline app. It informs the user that the unsynced data will be lost, and it provides them with the option to sync, logout (without syncing), or cancel.
I think your best option is to enforce the data being synchronized before logging of. You could do this by creating a nanoflow with a Sync action that after this action redirects to a page with a log of button for example.