Get role in middleware

How can I access the user's role via session in next.js middleware?
Solution:
Found the solution: const session = await getCookieCache(request); const isAdmin = session?.user?.role === "admin";...
Jump to solution
1 Reply
Solution
penguin
penguin4w ago
Found the solution: const session = await getCookieCache(request); const isAdmin = session?.user?.role === "admin";

Did you find this page helpful?