-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admin #16
Admin #16
Conversation
there are merge conflicts, please fix them |
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea looks good
const token = await getToken({ req: request }); | ||
const url = request.nextUrl; | ||
const token = await getToken({ req: request }); | ||
const url = request.nextUrl; | ||
|
||
if (url.pathname.startsWith("/admin")) { | ||
if (token?.role !== "ADMIN") { | ||
return NextResponse.redirect(new URL("/", request.url)); | ||
if (url.pathname.startsWith("/admin")) { | ||
if (token?.role !== "ADMIN") { | ||
return NextResponse.redirect(new URL("/", request.url)); | ||
} | ||
} | ||
} | ||
} | ||
|
||
// See "Matching Paths" below to learn more | ||
export const config = { | ||
matcher: ["/:path*", "/"], | ||
matcher: ["/:path*", "/"], | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file didnt change at all, what did you do here lol
No description provided.