feat: enhance security headers and update authentication and sitemap#1
Merged
JsCodeDevlopment merged 21 commits intomainfrom May 8, 2026
Merged
feat: enhance security headers and update authentication and sitemap#1JsCodeDevlopment merged 21 commits intomainfrom
JsCodeDevlopment merged 21 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…s for better authentication and database management, and update sitemap with new legal pages and pricing information
…ce site header with new pricing link and updated catalog label
…rs, and authentication flow components
…nd Google OAuth providers
…gement, and database schema updates
…ntent navigation, and analytics tracking
…cations, and development utility for Pro access
…table sections and database integration
…earch/filtering functionality
…ponents, and execution engine
…ses, and capstone assessment support
… controls and public profile display
…e module content progression
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request — Produto, footer, segurança, BRL e documentação
Use este ficheiro como corpo da descrição do PR (copiar para GitHub/GitLab). Ajusta o título da PR ao primeiro nível abaixo se quiseres que coincida com o convénio da equipa.
Resumo
Este conjunto de alterações melhora o layout do rodapé (links legais sem quebras estranhas), endurece a superfície de ataque das rotas sensíveis (cabeçalhos HTTP, rate limiting, limites de payload e validação de progresso), alinha a apresentação monetária em reais brasileiros (BRL) com variáveis de ambiente dedicadas, e adiciona documentação operacional (segurança e credenciais).
Contexto
Alterações principais
1. Footer (
SiteFooter)flex-nowrap,shrink-0,whitespace-nowrape scroll horizontal opcional em viewports muito estreitos (sem barra visível invasiva).items-startem desktop para o texto do criador não ficar verticalmente “centrado” face a duas linhas de conteúdo à esquerda.Ficheiro:
components/layout/site-footer.tsx2. Segurança
Cabeçalhos HTTP globais
X-Frame-Options: DENYX-Content-Type-Options: nosniffReferrer-Policy: strict-origin-when-cross-originPermissions-Policyrestritiva (câmara, microfone, geolocalização desativados)Strict-Transport-Security(HTTPS no host)Ficheiro:
next.config.tsRate limiting (memória, por instância)
POST /api/checkout— limite por utilizador autenticado (anti-abuso de criação de sessões de checkout).POST /api/progress/merge— limite por utilizador (anti-spam de merges).Ficheiros:
lib/security/rate-limit.ts,app/api/checkout/route.ts,app/api/progress/merge/route.tsMerge de progresso
lastLinesBySolution.Ficheiros:
app/api/progress/merge/route.ts,lib/progress/local-progress-schema.tsDocumentação de segurança
Ficheiro:
docs/seguranca.md3. Preços em BRL (UI)
formatPricingDisplay()passa a usarIntl.NumberFormat('pt-BR', { currency: 'BRL' }).NEXT_PUBLIC_PRICE_PRO_MONTHLY_BRL,NEXT_PUBLIC_PRICE_PRO_YEARLY_BRL(texto apenas; aceita vírgula ou ponto).formatFreeTierPrice()(ex.: R$ 0,00).Ficheiros:
lib/billing/pricing-env.ts,app/pricing/page.tsx,.env.example,docs/product-tiering.md4. Documentação de credenciais e ambiente
Ficheiro:
docs/credenciais-ambiente.mdFicheiros tocados (lista)
components/layout/site-footer.tsxnext.config.tslib/billing/pricing-env.ts,app/pricing/page.tsxapp/api/checkout/route.ts,app/api/progress/merge/route.tslib/security/rate-limit.ts,lib/progress/local-progress-schema.ts.env.exampledocs/seguranca.md,docs/credenciais-ambiente.md,docs/product-tiering.mdComo testar
/pricinge verificar R$ no plano Free e nos valores Pro (ajustar.env.localcomNEXT_PUBLIC_PRICE_PRO_*_BRLpara validar formatação).POST /api/progress/mergecom payload válido; repetir em excesso até esperar 429 (se quiseres validar o limite).curl -I) e confirmar cabeçalhos de segurança nas rotas da app.npx vitest runenpx tsc --noEmit.Migração / breaking changes
NEXT_PUBLIC_PRICE_PRO_MONTHLY_EUR/NEXT_PUBLIC_PRICE_PRO_YEARLY_EUR→NEXT_PUBLIC_PRICE_PRO_MONTHLY_BRL/NEXT_PUBLIC_PRICE_PRO_YEARLY_BRL(valores de exemplo no.env.example).STRIPE_PRICE_PRO_*) já estiverem em BRL no dashboard.Checklist antes do merge
.env.examplee documentação alinhados com o ambiente de staging/produção.STRIPE_WEBHOOK_SECRETcorresponde ao endpoint.NEXT_PUBLIC_APP_URLigual ao domínio público (Stripe redirects).Notas adicionais
docs/seguranca.md).Melhorias Completas — Sidebar, Navegação e Auth
1. Sidebar Desktop (xl+)
Ficheiros alterados:
SidebarProvider--sidebar-widthCSS variableComportamento:
localStorage<main>ajusta automaticamente via CSS custom property2. Navegação Prev/Next no Conteúdo
Ficheiros alterados:
getAdjacent*Funcionalidade:
3. Login / Register Redesenhados
Ficheiros alterados:
Melhorias visuais:
max-w-7xl: branding + value props à esquerda, formulário à direitaGoogle OAuth setup:
Important
Para ativar o login com Google, preencha as variáveis no
.env:Obtenha em Google Cloud Console → OAuth 2.0 Client IDs.
Redirect URI:
http://localhost:3000/api/auth/callback/googleDemo