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

+14
View File
@@ -175,6 +175,20 @@ session** (the `sessions` table is admin-write only, so speakers need this
security-definer RPC to attach their uploaded material). The attendee app calls
this after uploading a file to the `materials` bucket.
### `update_my_profile(p_linkedin_url, p_show_email, p_show_linkedin)` → `contacts`
**Self-service (any authenticated attendee).** Lets a contact edit their own
profile from the Convivo app: the LinkedIn URL and the two visibility toggles
(`show_email` / `show_linkedin`).
- Scoped to `current_email()` — a user can only ever update **their own** row.
- `linkedin_url` is trimmed; an empty/blank value is stored as `NULL`.
- The toggles default to `false` when `NULL` is passed.
- **Why an RPC?** The `contacts` RLS `UPDATE` policy is **admin-only**
(`contacts_admin_update`), so an attendee cannot update their own row directly
through PostgREST. This `security definer` function (owner `postgres`) bypasses
that, but is deliberately limited to the three self-service columns — it cannot
touch `is_admin`, `password`, `external_id`, etc.
- Returns the updated contact row.
## Interface sync RPCs (service-role-only)
Two additional `security definer` RPCs import external data. They are **not**