Closed Pratik2026 closed 12 months ago
@prajjwalkapoor It seems that when the user directly access the demo page, the user gets redirected to the home page as per the default value of isAuth state which is 'false'. This is due to the time delay in getting a response from checkAuth function. One possible solution would be to introduce a loading state which keeps the loading true until the response has been received from the server and then render the component accordingly. Let me know what you think about it.
@prajjwalkapoor It seems that when the user directly access the demo page, the user gets redirected to the home page as per the default value of isAuth state which is 'false'. This is due to the time delay in getting a response from checkAuth function. One possible solution would be to introduce a loading state which keeps the loading true until the response has been received from the server and then render the component accordingly. Let me know what you think about it.
yeah, we can do this.
Overview
Essential Checklist
Proof that changes are correct
ProtectedRoutes.webm