How can I do silent login on server (m2m) and update local cookie session immediately?

Hi all!

I am using nextjs and nextjs/auth0 package. It is working well but it doesn’t really check the central session state.

If I log out from another website with same issuer, I am still logged in due to local cookie session. ‘refetch’ or ‘refresh’ options don’t help.

I am using SSR and would like to do silent login there and update the session (so if I logged out on website2 it should fail and destroy session and do same in case I am logged out in nextjs app (website1) but logged in on website2. Is it really possible? checkSession method from useUser just calls /api/auth/me.

I can only do silent login on client (it returns proper response or ‘login-required’ error).

I should trigger router redirect to either login/logout after silent check so that local session will be updated based on my research. And it is big UX issue as it means the page will be refreshed each time I do such check.

Any ideas on that? I think it is a really common use-case