I am building an application and I want users to be able to log in from multiple devices without logging out of other devices.
How should I implement this functionality?
I am using Jwt token for authentication and MySQL database for storing user details
JWT is primarily use for performing
stateless authentication i.e. you don’t need to perform lookup in the database for validating the token. Also, Token contain some user details which are enough for identifying the owner of the token so you don’t need to store the token in the database.
I want users to be able to log in from multiple devices without
logging out of other devices.
You can issue multiple tokens to the same user requesting from different platforms. These token will have different
expiration time, so user remain log-in irrespective of the platform they would try to use and log out process will entirely depend upon the expiration time of the token.
Answered By – harry