Very kind of you to reply, thanks @rukshanjs 🙏 For my current needs, I don't actually need authentication at the socket level, so for now I just immediately return next(); and later when necessary, I'll send a token from my React FE (NextAuth) to validate the timers.
My implementation is a little more complex than yours, but your tutorial has been invaluable, thank you.
Another question: Have you experimented with a way to show all active timers in a room?
Hi @iaremarkus I'm super glad my series has been helpful. Currently with my implementation, a single room is for a single user (one user can have several devices and all those devices are within that room). The identifiers for each timer contains the userId in it. So to get all the timers within a room, I think we can use the userId to find the timers that contain it in the identifier/key of each timer.
In this series I'm tracking the timers (for each user device) as a single variable. But I have tried with implementing a Redis connection to keep this state on there so even if the server crashes the timers are still saved.
Very kind of you to reply, thanks @rukshanjs 🙏 For my current needs, I don't actually need authentication at the socket level, so for now I just immediately
return next();and later when necessary, I'll send a token from my React FE (NextAuth) to validate the timers.My implementation is a little more complex than yours, but your tutorial has been invaluable, thank you.
Another question: Have you experimented with a way to show all active timers in a room?
Hi @iaremarkus I'm super glad my series has been helpful. Currently with my implementation, a single room is for a single user (one user can have several devices and all those devices are within that room). The identifiers for each timer contains the
userIdin it. So to get all the timers within a room, I think we can use theuserIdto find the timers that contain it in the identifier/key of each timer.In this series I'm tracking the timers (for each user device) as a single variable. But I have tried with implementing a Redis connection to keep this state on there so even if the server crashes the timers are still saved.
good tip, i'll give that a go.
thanks again for the great series 👌