Good afternoon everyone, how are you?
Could you help me with a question, possibly regarding my application or backend (Nest.js) separate from the frontend (Next.js)?
In the case of frontend use, we have doubts about the most correct way to protect routes and session verification.
I need to protect the /dashboard route only for authenticated users with basically administrator permissions. The question is how much validation I should do on the frontend. Should I create an auth-utils file, a middleware file, use the protection in a layout.tsx file, or create a hook?