If user logins into another session/browser, system invalidates the first session.
Proposed high-level process, (excerpt from https://stackoverflow.com/questions/39881194/allow-one-concurrent-user-per-login-with-jwt)
- A user logs in, you store the Refresh Token in a DB
- The Access Token expires. Before you issue a new Access Token from your Refresh Token, make the standard check that the account is still OK, but also compare the Refresh Token to the one in your DB. Make sure they match.
- A second user logs in with the same account. Store the issues Refresh Token in the DB and over write the old Refresh Token. (One stored Refresh Token per account.)
- First users Access Token expires again. This time there is another Refresh Token in the DB, and no new Access Token is issued for that user.
Lets discuss options. Thanks.