Skip to content

Commit a2de473

Browse files
authored
Merge pull request #31 from Krish-2118/main
feat: QR checkin system
2 parents 91cfab3 + 69f919b commit a2de473

29 files changed

Lines changed: 3553 additions & 19 deletions

‎.env.example‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ SUPABASE_SERVICE_ROLE_KEY=
4848
# SUPABASE_SERVICE_KEY=
4949

5050

51+
# --- Entry passes (QR check-in at the venue) --------------------------------------------------------------
52+
# Required for entry passes. SECRET, server-only: 32 random bytes, base64. Encrypts each participant's QR token at rest
53+
# so POST /api/pass can show the owner the same QR on any device (the database only stores the token's SHA-256 plus
54+
# this ciphertext). Generate with:
55+
# node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
56+
# Set it once and keep it: changing it makes every QR already shown undecryptable (admins would have to reissue them).
57+
# Use a different value per environment (production, preview, local/test).
58+
ENTRY_PASS_ENCRYPTION_KEY=
59+
60+
5161
# --- Site identity and search engines -------------------------------------------------------------------
5262

5363
# Optional (public). The ONE canonical origin of the site (src/config/site.ts), no trailing slash. Used for canonical

‎next.config.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ const nextConfig: NextConfig = {
5959
{ key: "Cross-Origin-Opener-Policy", value: "same-origin" },
6060
],
6161
},
62+
{
63+
// The check-in scanner needs the camera. Must stay AFTER the global "/:path*" entry: when two entries set the
64+
// same header for a path, the last one wins (Next.js headers docs, "Header Overriding Behavior").
65+
source: "/admin/scan",
66+
headers: [
67+
{ key: "Permissions-Policy", value: "camera=(self), microphone=(), geolocation=(), payment=(), usb=()" },
68+
],
69+
},
6270
{
6371
// API responses carry personal data and tokens: never let a browser or CDN cache them. The two public,
6472
// anonymous endpoints (events, gallery) are excluded and set their own cache headers.

0 commit comments

Comments
 (0)