alpha wip
This commit is contained in:
@@ -4,20 +4,20 @@ import { getAppMode, isPublicRoute } from './lib/mode';
|
||||
|
||||
/**
|
||||
* Next.js middleware for route protection based on application mode
|
||||
*
|
||||
*
|
||||
* In pre-launch mode:
|
||||
* - Only allows access to public routes (/, /api/signup)
|
||||
* - Returns 404 for all other routes
|
||||
*
|
||||
* In post-launch mode:
|
||||
*
|
||||
* In alpha mode:
|
||||
* - All routes are accessible
|
||||
*/
|
||||
export function middleware(request: NextRequest) {
|
||||
const mode = getAppMode();
|
||||
const { pathname } = request.nextUrl;
|
||||
|
||||
// In post-launch mode, allow all routes
|
||||
if (mode === 'post-launch') {
|
||||
// In alpha mode, allow all routes
|
||||
if (mode === 'alpha') {
|
||||
return NextResponse.next();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user