next.js authorization example including private route protection. WARNING - This is probably not a great reference in 2023 and beyond, consider using next-auth.
In 2022, you should use vite instead of this