Skip to content

[WIP] Fix middleware to enforce payment requirement#319

Merged
LVT-ENG merged 1 commit intomainfrom
copilot/lvt-eng-fix-payment-middleware
May 6, 2026
Merged

[WIP] Fix middleware to enforce payment requirement#319
LVT-ENG merged 1 commit intomainfrom
copilot/lvt-eng-fix-payment-middleware

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 4, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>// PROYECTO: tryonyou-app (LVT-ENG)</issue_title>
<issue_description>import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'

// PROYECTO: tryonyou-app (LVT-ENG)
// ADMIN: Rubén Espinar (+33 6 99 46 94 79)

export function middleware(request: NextRequest) {
// Se controla desde las variables de entorno de Vercel
const isPaid = process.env.LICENSE_PAID === 'true';
const { pathname } = request.nextUrl;

// Permitir solo la página de pago y archivos estáticos
if (pathname.startsWith('/payment-terminal') || pathname.includes('_next') || pathname === '/favicon.ico') {
return NextResponse.next();
}

// Si no han pagado 109.900€, bloqueo total y redirección
if (!isPaid) {
return NextResponse.redirect(new URL('/payment-terminal', request.url));
}

return NextResponse.next();
}

export const config = {
matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)'],
};</issue_description>

Comments on the Issue (you are @copilot in this section)

@LVT-ENG Yes

@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tryonyou-app Ready Ready Preview, Comment May 4, 2026 8:45am
tryonyou-pilot Ready Ready Preview, Comment May 4, 2026 8:45am

Request Review

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.

// PROYECTO: tryonyou-app (LVT-ENG)

2 participants