My android app is using AWS Amplify for authentication, data storage & syncing (Cognito, S3, AppSync, API Gateway).
Amplify Android
I want to prevent the user to sign into multiple devices, I have a table Configuration and save the device id on it after a successful sign in, data syncing (get data from cloud) is done on the sign in process.
I added a logic on sign in process to check if the device id from cloud matches the current device id, if it doesn't match, the user will be asked if he wants to switch to the new device.
The problem I'm facing is that if user1 is currently logged in to Device A and user1 tries to log in to Device B and proceed to switch, the user is now logged in to 2 devices.
I didn't see any service or an api on amplify to notify Device A if the user logs in to another device, so I'm thinking if it's possible to revoke AppSync token/session on Device A so even user did a transaction on Device A it will not sync to the cloud.
Cognito Global sign out doesn't work: Amplify Auth globalSignOut
I want an efficient way to solve this as the amplify services have fees.
Amplify version im using is: 1.36.1