Skip to content
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

Merged
merged 12 commits into from
Sep 29, 2024
Merged

Admin #16

merged 12 commits into from
Sep 29, 2024

Conversation

Vyshnav001
Copy link
Collaborator

No description provided.

@joywin2003
Copy link
Contributor

there are merge conflicts, please fix them

@Vyshnav001
Copy link
Collaborator Author

there are merge conflicts, please fix them

Done

Copy link
Contributor

@joywin2003 joywin2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea looks good

Comment on lines -8 to 21
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*", "/"],
};
Copy link
Contributor

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

@joywin2003 joywin2003 merged commit 5cb37c6 into main Sep 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants