How to prevent same user logging in from different devices ? My app is paid , so I dont want credentials to be shared

后端 未结 2 799
时光说笑
时光说笑 2021-01-28 22:55

I am new to firebase , but I managed to develop an app using firebase -email&password authentication This app is for an organization\'s members so there is no sign up on th

2条回答
  •  遥遥无期
    2021-01-28 23:28

    I understand I should be using an auth token

    That won't work. Whenever a user signs in on a device, they get a new auth token. So the same user being signed in on two devices, will have to different auth tokens.

    But they will have the same UID. So I'd actually store the uid and something that identifies the active device in the database.

    activeDeviceByUser
      : 
    

    Then remove that when the user signs out or disconnects.

提交回复
热议问题