DEV Community

Discussion on: React Protected Routes (Next js & CRA) simple but efficient

Collapse
 
ataparvinghods profile image
Ata Parvin Ghods • Edited

Dear almokhtar
You are right my friend, everything in frontend is changable, BUT let's say you changed the code via browser and got access to admin's dashboard, there will be no data available for you and you cannot do/change anything cause you are not authorized. We make these routes private so normal people can't access to those routes but if they, they cannot harm your program or change anything.
In these code I put "userIsLoggedIn " as a boolean with true value but in a real program you could change that with authorization, So if the user authorized and got token then he/she can get access to those routes. Hope that you got the point

Collapse
 
almosaiki0 profile image
almokhtar

Thank you very much for your explanation.
I just want to say that if I got an access to the Admin Dashboard login site or something like this I could find out more information about your CMS and trying to look for Vulnerabilities . I will prefer to do the whole thing server Side. But your explanation is Great thanx