tl;dr: move authentication from useAuth
hook to the server side with laravel breeze with next.js?!
The situation
I am using a project setup like the original laravel breeze repo.
It ships with the useAuth hook, which handles the authentication on the client side.
This setup is barely satisfying as it does not utilize the server side rendering for all components that need authenticated content.
The Question
How could I provide a way to authenticate the user on the server side to gather all the information possible and render more on the server?
I don't need to get rid of useAuth at all.
My Attempt
I tried to move the hook getServerSideProps
but that is not allowed. My knowledge of the useSWR
used inside the useAuth
is slightly thin.