Next.js Discord

Discord Forum

Next Auth middleware

Unanswered
Mike posted this in #help-forum
Open in Discord
Hello, how can I extend the middleware so that I can query whether the user has the rank owner or admin. only then should the route /dashboard/users/settings be used. if the user does not have the rank, he should be redirected to the /dashboard page. the other routes should only have a query whether the user is logged in.

export { default } from "next-auth/middleware"
export const config = { matcher: ["/dashboard", "/dashboard/users/settings", "/dashboard/profile/settings"] }

0 Replies