Hi, I can't my wrap my head around how I can redirect users from login or register page to home if they are logged in already. I want to do this via a middleware. I tried to use getServerSession but that does not work in middleware.
I also used next-auth middleware but i am only able to protect pages from unauthenticated users not the opposite.
Thank you anyways 🙏