How to allow one device to be logged in at a time

Asked

Viewed 157 times

0

I have an app that when installed and logged in by firebase, the user will not be able to use your account on another device. In case, if you need to change the device the user will have to ask for the release to a supervisor.

I’m using native Android, firebase auth e firebase Realtime database.

I couldn’t think of an uncomplicated way to do this... Can anyone help me? Thanks in advance!

  • Why not write a token to the user table you saved on the device, and whenever you log compare the token

  • But if he clears the cache then it will complicate...

  • And if you record in the base device information?

1 answer

0

You can store user session information (such as device serial, date and time of access, etc.) in a Realtime Database node and manually control from this information whenever a user is authenticated in the application. This answer (in English) details an implementation of this approach.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.