feat: finalize ticket merging and speaker-aware imports
This commit is contained in:
1 parent
648daa0794
commit
4e71e9b797
35 files changed
+1772
-348
No files matched your search
@@ -18,7 +18,7 @@ export const supabase = createClient(url, anonKey, {
|
||||
|
||||
- **Same-origin by default.** `VITE_SUPABASE_URL` is intentionally left unset, so
|
||||
the client uses `window.location.origin`. The app is served behind a proxy
|
||||
(Vite dev server, or nginx in Docker) that forwards `/auth`, `/rest`,
|
||||
(Vite dev server, or nginx in Docker) that forwards `/auth/v1`, `/rest`,
|
||||
`/realtime`, `/storage` to the Supabase core. This avoids CORS entirely. See
|
||||
[../backend/docker.md](../backend/docker.md).
|
||||
- **Anon key only.** The client is created with the **anon key** (public). The
|
||||
@@ -82,6 +82,51 @@ client-side to avoid leaking other people's data:
|
||||
- **`sessionMaterialUrl(path)`** — builds the public URL for a session material
|
||||
in the `materials` bucket.
|
||||
|
||||
## Admin Email Entry
|
||||
|
||||
[adminEntry.ts](../../apps/convivo/src/lib/adminEntry.ts) handles email requests
|
||||
and the normal app's verified session profile. Before sending, it calls the
|
||||
read-only `can_request_admin_magic_link(p_email)` RPC. Eligibility requires both
|
||||
an existing Auth user and a contact authorized by the existing admin rule
|
||||
(`is_admin` flag or an `@appe.at` contact). Ineligible addresses do not trigger
|
||||
an OTP request. Eligible addresses use `signInWithOtp` with
|
||||
`shouldCreateUser: false` and
|
||||
`emailRedirectTo: window.location.origin + '/auth/callback'`.
|
||||
|
||||
Deployment requires
|
||||
[the eligibility migration](../../supabase/migrations/20261010093021_admin_magic_link_eligibility.sql)
|
||||
and an Auth redirect allowlist entry for
|
||||
`https://convivo.appe.at/auth/callback` (plus the corresponding URL for each
|
||||
development origin). These are deployment prerequisites, not automatic frontend
|
||||
configuration. Vite serves the callback as an SPA route rather than proxying it
|
||||
to Auth; nginx uses an exact callback location with no access logging, no-store
|
||||
caching and no-referrer policy. The document also sets no-referrer before assets
|
||||
load.
|
||||
|
||||
The callback accepts implicit token pairs or a PKCE code exactly once per page
|
||||
load, including StrictMode, and removes callback credentials from the address
|
||||
bar before network calls. `getUser(access_token)` verifies identity at the Auth
|
||||
server; `is_admin()` authorizes admin entry independently of editable metadata.
|
||||
Failed callbacks sign out locally. Normal restored/QR sessions also verify the
|
||||
user and admin role. Contact reads use the verified email; registration reads
|
||||
filter by both that email and the active event, returning null when absent.
|
||||
Admins need no registration or attendance state to use Convivo's existing staff
|
||||
experience. This login path performs no registration, attendance or points
|
||||
mutations.
|
||||
|
||||
Privacy boundary: the screen gives identical confirmations for eligible and
|
||||
ineligible addresses and suppresses account-existence errors from OTP. However,
|
||||
the public eligibility RPC returns a boolean that direct callers can inspect;
|
||||
it is not enumeration-resistant. This gates this UI's sends, not direct calls
|
||||
to Supabase Auth's OTP endpoint. The callback's server-backed admin check remains
|
||||
the access boundary.
|
||||
|
||||
Mocked browser regressions are in
|
||||
[convivo-admin-entry.spec.ts](../../e2e/tests/convivo-admin-entry.spec.ts);
|
||||
[SQL regressions](../../supabase/tests/admin_magic_link_eligibility_tests.sql)
|
||||
use rollback fixtures to check eligibility, grants and unchanged attendance
|
||||
data. Neither suite sends real OTP email.
|
||||
|
||||
## Speaker Portal
|
||||
|
||||
[speakerPortal.ts](../../apps/convivo/src/lib/speakerPortal.ts) recognizes only
|
||||
|
||||
Reference in new issue
Block a user