Next.js Discord

Discord Forum

Revalidate session server-side

Unanswered
GMatrixGames posted this in #help-forum
Open in Discord
I'm currently migrating from using all client pages to server as well. I have made an async getServerUser() function which grabs the user similar to my client hook.

My primary issue now is that the server auth call doesn't check every so often like my client one does. Is there a simple way to go about getting similar functionality (If the user gets signed out or their token gets killed, it will change the page state and redirect them away instead of letting them still interact).

0 Replies