DEV Community

Discussion on: Authentication in Next.js apps

Collapse
 
tmaximini profile image
Thomas Maximini

Hey - sorry for the late reply.
If you want to fetch custom data for a certain route you would just have a custom getServerSideProps for that page. Or you can adjust and rename getUserFromServerSession if you intend to fetch the same data on the server for multiple routes. The above was just one example how to you can refactor and reuse getServerSideProps for a couple of pages.