diff --git a/.env.example b/.env.example
index 1723519..3054a53 100644
--- a/.env.example
+++ b/.env.example
@@ -21,6 +21,5 @@ REDIS_URL=
AI_JOB_POLL_INTERVAL_MS=1000
# Alpha controls
-INVITE_ALLOWLIST=founder@example.com
DAILY_AI_TOKEN_LIMIT=250000
NUXT_PUBLIC_APP_URL=http://localhost:3000
diff --git a/PLAN.md b/PLAN.md
index 554dc4a..e593e0b 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -19,7 +19,7 @@ Dungeons & Ground — англоязычная веб‑платформа дл
### Пользовательский путь
-1. Вход по email magic link для пользователей из allowlist.
+1. Регистрация обязательного аккаунта по имени, email и паролю; вход по email/password и восстановление пароля через письмо.
2. Создание приватной вселенной через чат с AI‑соавтором.
3. AI задаёт 3–5 уточняющих вопросов о жанре, атмосфере, конфликте и желаемой роли игроков.
4. Создаётся редактируемый стартовый набор:
@@ -124,7 +124,7 @@ Desktop‑версия позднее создаётся через Tauri и и
### Недели 1–2 — фундамент
- Monorepo, Nuxt/Nitro, worker, CI и окружения.
-- Supabase Auth, allowlist, RLS и базовая схема данных.
+- Supabase email/password Auth, email confirmation/recovery, RLS и базовая схема данных.
- Англоязычный UI: login, dashboard, world list.
- OpenRouter adapter, учёт токенов, дневные квоты и безопасное хранение ключа.
- Первый вертикальный тест: действие игрока → worker → ответ AI.
@@ -183,7 +183,7 @@ Desktop‑версия позднее создаётся через Tauri и и
## 6. Зафиксированные ограничения
- Название `Dungeons & Ground` считается финальным, но перед публичным релизом обязательны проверка товарных знаков, домена и визуального сходства.
-- Первая версия: web, English-first, invite-only, private worlds.
+- Первая версия: web, English-first, обязательные email-аккаунты, private worlds и приглашения в кампании.
- Контент: 13+, без explicit‑материалов.
- OpenRouter оплачивает проект; пользователи не вводят собственные ключи.
- Оплаты нет — используются дневные, пользовательские и кампанийные лимиты.
diff --git a/README.md b/README.md
index 60ce249..652bb4d 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ pnpm dev:all
Open `http://localhost:3000`. `pnpm dev:all` starts the Nuxt site and the AI worker in one terminal. To run them separately, use `pnpm dev` in the first terminal and `pnpm dev:worker` in the second.
-To verify the complete hosted-Supabase multiplayer path (two temporary guests, invite, AI character draft, persistent AI companion, shared readiness, AI resolution, and the next round), keep `dev:all` running and execute `pnpm smoke:multiplayer` in another terminal.
+To verify the complete hosted-Supabase multiplayer path (two temporary email accounts, invite, AI character draft, persistent AI companion, shared readiness, AI resolution, and the next round), keep `dev:all` running and execute `pnpm smoke:multiplayer` in another terminal.
Before starting either process, the root commands check the Supabase schema. If it is missing and `SUPABASE_DB_URL` is configured, they transactionally create all D&G tables, functions, triggers, indexes, and policies from `supabase/bootstrap.sql`. Copy the **Session pooler** URI from the Supabase Dashboard **Connect** panel into the root `.env` and replace the password placeholder with the URL-encoded database password. The database URL is server-only and must never use a `NUXT_PUBLIC_` prefix.
@@ -47,7 +47,7 @@ Use Node.js 18.20.5 or newer. The lockfile pins the web toolchain to the Node 18
## Production services
1. Copy the Supabase **Session pooler** connection URI from **Connect** into `SUPABASE_DB_URL`. `pnpm dev:all` now detects an empty project and creates the complete schema automatically. `pnpm db:ensure` runs the same guarded bootstrap without starting the app. Manual SQL Editor installation remains available through `supabase/bootstrap.sql`.
-2. In Supabase Auth settings, enable **Allow anonymous sign-ins**. In Auth URL Configuration, set the Site URL to `http://localhost:3000` and add `http://localhost:3000/auth/callback` as a Redirect URL. Email magic-link accounts remain optional and must be added to `public.allowlist`. Before external testing, enable CAPTCHA and review Supabase's anonymous sign-in rate limits so disposable guests cannot be used to evade AI quotas.
+2. In Supabase Auth settings, enable the **Email** provider and disable **Allow anonymous sign-ins**. In Auth URL Configuration, set the Site URL to `http://localhost:3000`; add `http://localhost:3000/auth/callback` and `http://localhost:3000/auth/reset-password` as Redirect URLs. Configure SMTP before external testing so confirmation and recovery email is delivered reliably. CAPTCHA and Auth rate limits remain recommended.
3. Run `pnpm dev:worker` alongside the web process. Provision Redis only when BullMQ delivery is desired; otherwise the worker polls the Supabase outbox.
4. Configure either `OPENROUTER_API_KEY` (default model `deepseek/deepseek-v4-flash`) or set `AI_PROVIDER=deepseek` with `DEEPSEEK_API_KEY` (default model `deepseek-v4-flash`, endpoint `https://api.deepseek.com/chat/completions`).
@@ -55,10 +55,10 @@ If the worker reports `POST /rest/v1/rpc/claim_ai_job 404` and `/rest/v1/profile
## Weeks 3–4 flow
-1. Click **Enter the Alpha** to create a persistent guest session without email. Do not sign out or clear site storage unless you are prepared to lose that guest account. An allowlisted email magic link is still available as an alternative.
+1. Click **Enter the Alpha** to open registration. Every account requires a display name, email, password, and 13+ confirmation. Existing users sign in with email/password; forgotten passwords use the email recovery flow.
2. Create a world in the dynamic coauthor chat. Unfinished conversations and generated drafts appear on the dashboard and resume after a reload.
3. Review every starting-world field, including the owner-only hidden threat, then confirm it.
4. Create a human character manually or ask the coauthor for an editable draft. Owners can add persistent AI companions the same way.
-5. The owner creates an expiring private invite link. Guest or allowlisted-email users join through `/join/:token`.
+5. The owner creates an expiring private invite link. Signed-in email users join through `/join/:token`.
6. Players save actions and mark them ready. The final ready action queues the round automatically; the owner can also continue without waiting.
7. The worker resolves server-owned rolls and state, publishes narration, and opens the next round. Visible campaign tabs synchronize every two seconds and immediately when the tab regains focus.
diff --git a/apps/web/components/AppShell.vue b/apps/web/components/AppShell.vue
index 49919fb..11cbd02 100644
--- a/apps/web/components/AppShell.vue
+++ b/apps/web/components/AppShell.vue
@@ -4,12 +4,12 @@ const { session, restore, signOut } = useDngAuth()
onMounted(() => void restore())
const initials = computed(() => {
- const email = session.value?.user.email ?? ''
- return email.slice(0, 2).toUpperCase() || 'G'
+ const displayName = session.value?.user.user_metadata?.display_name
+ const source = typeof displayName === 'string' && displayName.trim() ? displayName : session.value?.user.email ?? ''
+ return source.trim().split(/\s+/).map(part => part[0]).join('').slice(0, 2).toUpperCase() || 'D&G'
})
async function leave() {
- if (session.value?.user.is_anonymous && !window.confirm('This guest account cannot be recovered after sign out. Leave anyway?')) return
await signOut()
await navigateTo('/')
}
@@ -22,7 +22,7 @@ async function leave() {
CHECK YOUR EMAIL. The recovery link can be used once and expires automatically.
+
+ ← BACK TO SIGN IN
+
+
diff --git a/apps/web/pages/auth/reset-password.vue b/apps/web/pages/auth/reset-password.vue
new file mode 100644
index 0000000..fd16711
--- /dev/null
+++ b/apps/web/pages/auth/reset-password.vue
@@ -0,0 +1,54 @@
+
+
+
+
+
VERIFYING RECOVERY LINK…
+
+
{{ error }}
+ BACK TO SIGN IN
+
+
diff --git a/apps/web/pages/auth/sign-in.vue b/apps/web/pages/auth/sign-in.vue
new file mode 100644
index 0000000..3e4207d
--- /dev/null
+++ b/apps/web/pages/auth/sign-in.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+ New to D&G? CREATE ACCOUNT
+
+
diff --git a/apps/web/pages/auth/sign-up.vue b/apps/web/pages/auth/sign-up.vue
new file mode 100644
index 0000000..5acb231
--- /dev/null
+++ b/apps/web/pages/auth/sign-up.vue
@@ -0,0 +1,80 @@
+
+
+
+
+
+ CHECK YOUR EMAIL. We sent a confirmation link to {{ email }}. Open it to activate your account.
+
+
+ Already have an account? SIGN IN
+
+
+
+
diff --git a/apps/web/pages/dashboard.vue b/apps/web/pages/dashboard.vue
index 69670b2..b9454c0 100644
--- a/apps/web/pages/dashboard.vue
+++ b/apps/web/pages/dashboard.vue
@@ -74,7 +74,7 @@ onMounted(async () => {
RECEIVING PRIVATE CAMPAIGNS…
-
{{ error }} SIGN IN AGAIN
+
{{ error }} SIGN IN AGAIN
{{ campaign.status.toUpperCase() }} CAMPAIGN
PRIVATE MULTIPLAYER
{{ campaign.title }}
{{ campaign.current_scene }}
CONTINUE STORY{{ new Date(campaign.updated_at).toLocaleDateString() }}
diff --git a/apps/web/pages/index.vue b/apps/web/pages/index.vue
index b465b32..e142042 100644
--- a/apps/web/pages/index.vue
+++ b/apps/web/pages/index.vue
@@ -1,9 +1,5 @@
@@ -65,7 +32,6 @@ async function requestAccess() {
SEE HOW IT WORKS
-