My question is, is there any way to keep users logged even if the browser is refreshed?
I've looked in the forum for other references and the closer I found was:
Need advice on actions before joining a room
I was reading this link:
https://stackoverflow.com/questions/43492717/how-to-keep-user-logged-in-even-after-reloading-the-main-file-index-js
In which the solution was to implement express-session and passport.
And this other:
https://www.linkedin.com/pulse/nodejs-user-session-management-web-applications-using-harshad-bankar/
In which only express-session was implemented with some examples about the login action.
And I was thinking on create a flow like this:
-> express to show the /login form
-> a /loginPost action to validate the user in the DB
-> at tha point register the user in the session with express-session
-> and for last redirect the user to game-room
-> there I'll re-validate the session (again with express-session) and run the join-room method
Will that be ok? Because I feel like I'm missing something related to rooms onAuth or some like that which could be better...
If I'm not missing anything I hope this could be a small contribution.
Thanks!