Hello, I am using nextjs as frontend and node/expressJS server for the backend
I am having issues regarding the authentication/authorization
What i am trying to do :
On frontend : SAY : i want my adminpage to be a protected routed =
What i am doing is that i am using UseEffect hook to see if my user is authhorized [screenshot provided].
where my main function shouldLoadRoute() is , which is similar as provided in the documentation.
The issue is
1. have to create a loading state to prevent the flash of sensitive data i.e Content of adminpage
2. the sensitive data can be seen in console as it was fetched