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