I have a SAAS solution app that was developed using Flutter. And it uses Firebase as the backend. When a user creates a subscription (in the subscription collection), it has following fields such as
- deviceID
- subscriptionID
- subscriptionStatus
the subscriptionStatus is handled by another app and status could be changed from “active” to “suspend”. When users log into the mobile app account via Firebase email password login,next they have to select a subscription to proceed in the app. If the deviceID of that subscription is empty user can proceed through. The app will save its deviceID in the subscription document. If deviceID is not empty and does not match the current device it will not allow the user to proceed forward in the app.
There will be a scenario where a new device may want to use an already used subscription. In that case, I want to log out the old device and let new device use that subscription. (and save the new deviceID in the document). How can I do this force log out remotely ?