This line of code redirects the user to the menu page if they already have a token saved in localstorage. However, the check for the token is redundant because if the token is not present in localStorage, localStorage.getItem('token') will return null which somehow false.
If I asked "Why could this flaw appear?: I probably would say because I generally more task-goal-oriented. so I did what I know without any consideration on the beauty of the code
This line of code redirects the user to the menu page if they already have a token saved in localstorage. However, the check for the token is redundant because if the token is not present in localStorage, localStorage.getItem('token') will return null which somehow false.
If I asked "Why could this flaw appear?: I probably would say because I generally more task-goal-oriented. so I did what I know without any consideration on the beauty of the code