π¨ The ultimate agentic social media scheduling tool π€
TypeScript nextjsopen-sourceopen-source-social-media-scheduling-toolosspostiz-cloudpostiz-hostedredisscheduling-toolsocial-media-scheduling-tooltypescript
fix: redirect /auth/register to /auth/login when registration is disabled
swaraj017472ef851c24b
diff --git a/apps/frontend/src/middleware.ts b/apps/frontend/src/middleware.tsindex 6152560b6..fe9059de1 100644--- a/apps/frontend/src/middleware.ts+++ b/apps/frontend/src/middleware.ts@@ -70,6 +70,13 @@ export async function middleware(request: NextRequest) {return response;}+ if (+ nextUrl.pathname.startsWith('/auth/register') &&+ process.env.NEXT_PUBLIC_DISABLE_REGISTRATION === 'true'+ ) {+ return NextResponse.redirect(new URL('/auth/login', nextUrl.href));+ }+const org = nextUrl.searchParams.get('org');const url = new URL(nextUrl).search;if (!nextUrl.pathname.startsWith('/auth') && !authCookie) {@@ -160,4 +167,4 @@ export async function middleware(request: NextRequest) {// See "Matching Paths" below to learn moreexport const config = {matcher: '/((?!api/|_next/|_static/|_vercel|[\\w-]+\\.\\w+).*)',-};+};\ No newline at end of file