So basicaly i have some server component that fetches data and displays it. But it displays it only when user authorized:
function FirstServerComponent() {
const isAuth = // checking if user authorized
return (
<div>
{isAuth ? (
<SecondServerComponent/>
): (
<p>unauthorized</p>
)}
</div>
);
}
And in the header of my page there is a button that’s starts oauth authorizaion flow then redirects back to our page and setting our isAuth
state to true.
So how do i rerender FirstServerComponent
so it can render SecondServerComponent