Admin password login + attendee profile self-service

- contacts.password: admin-only APPE Admin login password (event-independent);
  must match the bcrypt hash in auth.users.encrypted_password (set in Supabase).
- APPE Admin login is now email + password (was QR token).
- update_my_profile RPC (security definer, scoped to current_email()): attendees
  set their LinkedIn URL + show_email / show_linkedin toggles from the Profile.
- Convivo Profile gains a 'Profile settings' card (LinkedIn + 2 toggles + Save).
- Visibility enforced server-side in the public projection (linkedin nulled when
  show_linkedin off, email omitted when show_email off).
- Seed: admin password appe-admin-2026; staff keep QR tokens as auth passwords.
- Docs updated (schema, rpcs, seed, admin-app, screens, api-client,
  architecture, next-steps, README, docker-compose).

Co-authored-by: Stephan Charles <[email protected]>
Co-authored-by: Amelia Hernandez <[email protected]>
Co-authored-by: Markus Franz <[email protected]>
Co-authored-by: Sabrina Hota <[email protected]>
Co-authored-by: Nilüfer Doğan <[email protected]>
This commit is contained in:
committed 2026-08-23 14:11:26 +02:00
1 parent 2f3952dc71
commit 0221b1a8c0
19 files changed
+290 -59

No files matched your search

+36 -3
View File
@@ -4,10 +4,12 @@ What's done, what's next, and the open decisions. The full roadmap lives in the
root [`roadmap.md`](../roadmap.md); this file is the working detail for the
current phase.
> **Current state:** Phases 0–8 are complete and verified, plus a round of
> **Fixes & Refinements** (QR token moved to the registration, role-pill
> **Current state:** Phases 0–8 are complete and verified, plus two polish
> rounds: **Fixes & Refinements** (QR token moved to the registration, role-pill
> capitalization, connection detail sheet + red-dot recalc, admin schedule
> speaker multi-select + upload/speaker bug fixes, sponsor contact search).
> speaker multi-select + upload/speaker bug fixes, sponsor contact search) and
> **Admin password + profile self-service** (admin logs in with email + password;
> attendees set LinkedIn + visibility on their Profile).
> Remaining work is cross-cutting (real event clock, deployment, testing) and
> the open questions in [backend/interfaces.md](./backend/interfaces.md).
@@ -236,6 +238,37 @@ A cross-cutting polish round (migration `20260826000000_registration_qr_token.sq
- **"My picks today"** — shows only **2 rows** (current + next slot's pick);
"tap to change" is a **hyperlink** to the Agenda.
## Admin password + profile self-service — ✅ complete
Migration `20260827000000_admin_password_profile.sql` + app changes, all
browser-verified.
**APPE Admin login = email + password (event-independent).**
- `contacts.password` (admin-only) records the APPE Admin login password. To
work it must match the bcrypt hash in `auth.users.encrypted_password` — set
directly in Supabase (no self-service UI/procedure).
- The admin app's Login screen is now **Email + Password** (was QR token).
`AuthContext.signIn(email, password)` still calls `signInWithPassword` + the
`is_admin` guard.
- **Design decision:** Supabase Auth has one password per user. The dedicated
admin uses a real password (works for any event). Staff (Bruno/Rita) keep
their QR tokens as their Auth password — they can still log into the attendee
app, and can also open the admin app with email + QR token.
- Seed: the admin's password is `appe-admin-2026` (in both `contacts.password`
and `auth.users.encrypted_password`); all other contacts have `password = NULL`.
**Convivo App — Profile self-service.**
- New **Profile settings** card: a **LinkedIn** URL input + two **visibility
toggles** ("Show my email" / "Show my LinkedIn") + **Save profile**.
- Saving calls the new `update_my_profile(p_linkedin_url, p_show_email,
p_show_linkedin)` RPC (security-definer, scoped to `current_email()`, limited
to those 3 columns) — needed because the `contacts` UPDATE policy is
admin-only, so an attendee can't update their own row via PostgREST.
- Visibility is enforced **server-side**: the public projection
(`lanyard_lookup` / `get_public_contacts`) nulls `linkedin_url` when
`show_linkedin` is off and omits the email when `show_email` is off, so the
toggles actually control what other attendees see.
## Cross-cutting / later
- **Real event clock** — replace the simulated `DEFAULT_NOW`