User undefined in advanced node and express chat app

I built the chat app in the challenges and passed all the tests but it seems that when I try the Local registration or login method my, I’ll be redirected to the profile page as normal… but when I change the URL to go to /chat instead of /profile it will make my name undefined instead of actually getting the username… I was trying to figure out why for a very long time… any help would be appreciated…

code: https://replit.com/@MidoZZX/boilerplate-advancednode