roomber-dev / roomber

Roomber is a messaging webapp that is currently in a lot of development and this is one of it's early, unreleased versions!
GNU General Public License v3.0
4 stars 1 forks source link

Fix loginInit to avoid infinite loop in client #23

Closed SuromiDev closed 2 weeks ago

SuromiDev commented 2 weeks ago

Using null instead of "" fixes the issue where the user didn't get the registration/login popup due to the client expecting session and userid values in cookies to be "". If session and userid weren't created in cookies, it would attempt to connect to a nonexistent session.

neksodebe commented 2 weeks ago

Suggestion

Instead of doing value == null, do !value.

The getCookie function can also return an empty string if the cookie is there, but empty. I'm pretty sure logging out works by expiring the cookies, but I feel like checking with ! is better off doing anyways.

image source here

I tested this too: image

neksodebe commented 2 weeks ago

LGTM