[Nextauth] How to use middleware with grouped routes?

I have an application where admin pages are in a grouped route /app/(admin)/dashboard rather than /app/admin/dashboard.

Is there a way for the nextauth middleware matcher to protect grouped routes?
Was this page helpful?