RPI-ITWS / ITWS-2110-F24-LuckyCharms

2 stars 0 forks source link

Zhengm4 user homepage #16

Closed mirmirmirr closed 1 month ago

mirmirmirr commented 1 month ago
BradsherC commented 1 month ago

I added a new commit so that the labs displayed depend on the userid value, which is stored as a cookie when they log in; previously, the userid was hardcoded as 1

mirmirmirr commented 1 month ago

Do you know if there is a way to check this on our end while we don't have the login connected yet?

BradsherC commented 1 month ago

Now the user and admin homepages both redirect back to the login page if the userid or admin cookies aren't set, or if you're on the wrong page (e.g. if an admin is on the normal user homepage). If you're on the login page and enter a username and password combination that are in data.json (e.g. "Jane Doe" with "pass1"), it will delete old cookies and set them with the current userid and whether they're an admin, then redirect to the appropriate homepage. If you want to test this with live preview, I recommend opening it in the browser instead of just in VSCode to make sure that the JS works right.

Christian2147 commented 1 month ago

Looks good. Can create an issue for any further problems.