I'm using nextjs for my frontend and expressjs for my backend. How can I get the user info on nextjs server (in my middleware) since the auth server config is on my expressjs backend
You shouldnt do that in the middleware. Normally you just fetch the endpoint (like get-session or make your own) to get the current session. (or use the auth-client if on the client-side)