---
id: TASK-19
title: Add EncryptID auth header and gate community creation
status: Done
assignee: []
created_date: '2026-02-17 00:51'
labels:
  - auth
  - ui
  - encryptid
dependencies: []
priority: high
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Add a persistent header bar with EncryptID sign-in/sign-up across all rSpace pages (landing + canvas). Gate the "Create Community Space" form behind authentication — shows a passkey auth modal if the user isn't signed in. Auth tokens are sent with the community creation API call.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Header bar with sign-in button on landing page (dark theme)
- [x] #2 Header bar with sign-in button on canvas page (light theme)
- [x] #3 Auth modal with sign-in and register flows using WebAuthn passkeys
- [x] #4 Create Community form requires auth — shows modal if not signed in
- [x] #5 Bearer token sent with community creation API call
- [x] #6 User avatar and dropdown menu when logged in
- [x] #7 EncryptID modules lazy-loaded only when auth triggered
<!-- AC:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Implemented in commit da48f6f. Created lib/rspace-header.ts shared module with mountHeader(), showAuthModal(), requireAuth() functions. Modified both website/index.html and website/canvas.html to mount the header. Added @encryptid vite alias for lazy-loading WebAuthn modules.

Follow-up fix in 46d8429: header now re-renders after auth via the requireAuth() flow (e.g. community creation form), so the Sign In button updates to show the user avatar immediately.

Docker build fixed in fd25996/6bafcf3: switched to self-contained build context with additional_contexts for encryptid-sdk, added .dockerignore, skipped tsc in Docker build.

Auto-deploy configured: added rspace-online to deploy-webhook REPOS + created Gitea webhook (ID 74). Pushes to main now auto-deploy.
<!-- SECTION:FINAL_SUMMARY:END -->
