time a user can login to only one device.
I'm using node js and jwt.
So for that what I did is I'm checking the token while signing in and clearing the token while sign Out.
SO whenever he logs in if the token is not empty it will through error to sign out from the previous device.
This is fine till here.
So for signing out from the previous device, I'm deleting his token but he can still able to access the app because the problem is the Same token is generating for the user every time he logged in.
Since the previous device also contains the token which is same as newly generated one. That device is also able to acces everything.
Is there any way to generate new different token when a user logs in. ?
So the previous one will not able to acces
You can't revoke JWT, so JWT is the wrong choice if you want to limit multiple logins
Обсуждают сегодня