I'm trying to create a realtime function that if the user's token is expired they would be logout automatically. I tried logging out the user if I got a 401 status code
but sometimes I do receive an error using that and I'm also be using socket-io
on my the project cause I need to display data in real time.
I uploaded the sample project on github and so far this is what I've done. It contains just the login/register/logout function
I also found this how-do-i-check-for-token-expiration-and-logout-user but I don't know how to wrap the function on applymiddleware
.
And one last thing why am I getting 24 vulnerabilities (8 moderate, 15 high, 1 critical)
on npm audit. I'm using node v14.18.0
for this project