How to make user login from only one device at a time

后端 未结 7 2880
予麋鹿
予麋鹿 2021-02-04 16:47

I have a RestAPI which when hit authenticate the user. This api is exposed to android and ios developers they hit this api to allow user to login to our app

My requireme

7条回答
  •  情书的邮戳
    2021-02-04 17:33

    Hello you can do one thing. Track user login status. like

    1. while user login add entry that user is active or login
    2. now while user is trying to login with another device at that time check that user is login/active or not. if user is active then don't allow them for login and display message that logout from your old device. You can also put auto logout from last device functionality also.
    3. While user is logout at that time change user status active/login to not-active/logout so by this way you can manage this.

    You have to pass this user status with your login web Service or API in android and in website you can directly check from DB.

提交回复
热议问题