Skip to content

Commit d6a0dbb

Browse files
committed
fix: allow public access to landing page in middleware
1 parent bf91138 commit d6a0dbb

2 files changed

Lines changed: 206 additions & 5 deletions

File tree

middleware.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ export function middleware(request: NextRequest) {
1111
request.nextUrl.pathname === '/auth/verify-2fa' ||
1212
request.nextUrl.pathname === '/auth/forgot-password' ||
1313
request.nextUrl.pathname === '/auth/reset-password';
14-
const isPublicPayPage = request.nextUrl.pathname.startsWith('/pay');
14+
const isPublicPage = request.nextUrl.pathname === '/' || request.nextUrl.pathname.startsWith('/pay');
1515
const isAdminRoute = request.nextUrl.pathname.startsWith('/admin') ||
1616
request.nextUrl.pathname === '/overview' ||
1717
request.nextUrl.pathname === '/merchants' ||
1818
request.nextUrl.pathname === '/anchors' ||
1919
request.nextUrl.pathname === '/fx-management' ||
2020
request.nextUrl.pathname === '/compliance';
2121

22-
// Allow public access to payment links
23-
if (isPublicPayPage) {
22+
// Allow public access to landing page and payment links
23+
if (isPublicPage) {
2424
return NextResponse.next();
2525
}
2626

0 commit comments

Comments
 (0)