changing page in server-side components
Unanswered
Cape lion posted this in #help-forum
Cape lionOP
In (main) route groups, I have layout.js as Server Component. In that layout i am fetching a token-check api to my backend (i am using microservices). From that context i have 2 question:
1. I am using version in url of my API. If the version is not match to version of deployed backend, i want to full reload in user's tab browser (like 'location.reload()'). How can i do this?
2. If the response of token-check is invalid i want to navigate user to login page (i put login folder outside (main) route groups). There is such thing as useRouter() that work in Server Component?
1. I am using version in url of my API. If the version is not match to version of deployed backend, i want to full reload in user's tab browser (like 'location.reload()'). How can i do this?
2. If the response of token-check is invalid i want to navigate user to login page (i put login folder outside (main) route groups). There is such thing as useRouter() that work in Server Component?