rp_st
08/03/2020, 6:13 AMsupertokens.getAllSessionsForUser(userId)
(in Node JS).
- If the returned array length is >= 1, then don't allow the user to login, else successfully log them in.
If you want this to be race condition proof, then in your login API, after you check the user's password, then you should take a distributed lock on the userId, and then do the above check.