Next.js Authentication Tutorial

Solution:

  if (ctx.req && ctx.req.session && ctx.req.session.passport) {
         pageProps.user = ctx.req.session.passport.user;
  }

This allows build but isnt a solution for SSR. Ended up rebuilding the project.

1 Like