Skip to content

Commit 1af1c81

Browse files
committed
No registration allowed for non-admins
1 parent cef2853 commit 1af1c81

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

src/components/common/cta-section-2.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default function FullScreenCTA() {
8282
size="lg"
8383
className="bg-red-600 hover:bg-red-700 text-white py-6 px-4 text-xl transition-all duration-300 transform hover:scale-105 mt-8"
8484
>
85-
Register Now
85+
Registrations Open Soon
8686
</Button>
8787
</Link>
8888
{/* <p className="text-sm text-gray-400">

src/components/widget/header.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ const Nav = () => {
189189
size="lg"
190190
className="bg-red-600 hover:bg-red-700 text-white py-4 "
191191
>
192-
Register Now
192+
Registrations Open Soon
193193
{/* <ArrowRight className="ml-2" /> */}
194194
</Button>
195195
</Link>

src/components/widget/hero.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export default function HeroHighlight() {
129129
size="lg"
130130
className="bg-red-600 hover:bg-red-700 text-white py-2 transition-all duration-300 transform hover:scale-105"
131131
>
132-
Register Now
132+
Registrations Open Soon
133133
</Button>
134134
</Link>
135135
</div>

src/middleware.ts

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ export async function middleware(request: NextRequest) {
1313
return NextResponse.redirect(new URL("/", request.url));
1414
}
1515
}
16+
if (url.pathname.startsWith("/register")) {
17+
if (token?.role !== "ADMIN") {
18+
return NextResponse.redirect(new URL("/", request.url));
19+
}
20+
}
21+
1622
}
1723

1824
// See "Matching Paths" below to learn more

0 commit comments

Comments
 (0)