Only allow one active session at a time
Hi all, I am trying to implement a feature after a pay wall that requires user to have only one active session at the same time (if user tries to log in on another device, old device will be logged out)
Please help to guide me a way, any idea is appreciated. Thanks!
Solution:Jump to solution
Not sure if it is the best approach but I achieved this by deleting all the session for that user except the newSession in the after hook. @phipham
3 Replies
Solution
Not sure if it is the best approach but I achieved this by deleting all the session for that user except the newSession in the after hook. @phipham
there is also
authClient.revokeOtherSessions()
which you can run as soon as the user signin
but it was not working for me so i did it this wayThanks for your answer! I will definitely have a try 🙏