There isn't much to actually refactor here, just need to use the universal-cookies library's features for adding a max age to the cookies, this also ties into the can log in multiple times issue: #2
The client should say, if there is a cookies, do not let the user submit a request to log in, also, until request has finished, do not let the user submit another request, there also needs to be some functionality on the backend that doesn't let the user send a request to log in multiple times (maybe using device identification?), although this may be natural already with express's asynchronous nature, so express will wait for the other requests to finish, so if the user does send multiple requests to login, I can just check if there is already a session for that user.
There isn't much to actually refactor here, just need to use the
universal-cookies
library's features for adding a max age to the cookies, this also ties into the can log in multiple times issue: #2The client should say, if there is a cookies, do not let the user submit a request to log in, also, until request has finished, do not let the user submit another request, there also needs to be some functionality on the backend that doesn't let the user send a request to log in multiple times (maybe using device identification?), although this may be natural already with express's asynchronous nature, so express will wait for the other requests to finish, so if the user does send multiple requests to login, I can just check if there is already a session for that user.