feat(pitch-deck): branded short links for magic URLs (pitch.breakpilot.ai/p/ab3xk2)
Build pitch-deck / build-push-deploy (push) Successful in 1m31s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 32s
CI / test-python-voice (push) Successful in 34s
CI / test-bqas (push) Successful in 30s

- New pitch_short_links table stores 6-char alphanumeric codes mapped to magic link tokens
- GET /p/[code] redirects to /auth/verify?token=... (302, validates expiry)
- All magic link generation points (invite, generate-link, resend) now create a short code
- Emails (invite + resend) use the short URL — less token-like, cleaner for spam filters
- Copy-link UI shows short URL prominently with full URL as fallback
- Migration 008 added to /api/admin/migrate

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Sharang Parnerkar
2026-05-07 10:34:24 +02:00
parent 54f0919b73
commit 76aad8b1d1
9 changed files with 87 additions and 17 deletions
+21
View File
@@ -0,0 +1,21 @@
import { NextRequest, NextResponse } from 'next/server'
import pool from '@/lib/db'
interface Ctx { params: Promise<{ code: string }> }
export async function GET(request: NextRequest, ctx: Ctx) {
const { code } = await ctx.params
const { rows } = await pool.query(
`SELECT sl.token FROM pitch_short_links sl
JOIN pitch_magic_links ml ON ml.token = sl.token
WHERE sl.short_code = $1 AND ml.expires_at > NOW()`,
[code.toLowerCase()],
)
if (rows.length === 0) {
return NextResponse.redirect(new URL('/auth?error=invalid', request.url))
}
return NextResponse.redirect(new URL(`/auth/verify?token=${rows[0].token}`, request.url))
}