petrgazarov
04/23/2023, 7:28 AMrp
04/23/2023, 7:34 AMpetrgazarov
04/23/2023, 7:43 AMif (pageProps.fromSupertokens === 'needs-refresh') {
return null;
}
)
The redirect to auth from there (and the rendering of the login page) happens on the browser, I think.rp
04/23/2023, 7:45 AMpetrgazarov
04/23/2023, 7:46 AMrp
04/23/2023, 7:47 AMpetrgazarov
04/23/2023, 7:50 AMif (!context.req.cookies['sAccessToken']) {
return {
redirect: {
destination: `/auth?redirectToPath=${context.resolvedUrl}`,
permanent: false,
},
};
}
// rest of the code
and now the server responds with 307 Temporary Redirect when the user is logged out 👍.rp
04/23/2023, 8:05 AMpetrgazarov
04/23/2023, 8:05 AMrp
04/23/2023, 8:06 AMpetrgazarov
04/23/2023, 8:06 AM