feat(auth): switch signup to OTP verification flow
Replace legacy signup with start/verify/resend endpoints, add OTP-focused mail templates and auth rate limits, and align compose/env/runbook for local self-hosted Supabase OTP behavior.
This commit is contained in:
@@ -102,7 +102,6 @@ tmux kill-session -t social-dev
|
||||
|
||||
| 环境变量 | 说明 | 默认值 | 有效范围 |
|
||||
|----------|------|--------|----------|
|
||||
| `SOCIAL_WEB__SERVER` | Web 服务器类型 | gunicorn | uvicorn/gunicorn |
|
||||
| `SOCIAL_WEB__HOST` | 监听地址 | 0.0.0.0 | - |
|
||||
| `SOCIAL_WEB__PORT` | 监听端口 | 8000 | 1-65535 |
|
||||
| `SOCIAL_WEB__RELOAD` | 开发模式热重载 | false | true/false |
|
||||
@@ -143,11 +142,24 @@ docker compose --env-file .env -f infra/docker/docker-compose.yml --profile job
|
||||
## Auth/Profile 验证
|
||||
|
||||
```bash
|
||||
# signup: username + email + password
|
||||
curl -sS -X POST http://127.0.0.1:8000/api/v1/auth/signup \
|
||||
# 注意:默认模板地址 http://mail-templates/* 仅在 Docker Compose 内网可用。
|
||||
# 生产环境请替换为 gotrue 可访问的模板 URL。
|
||||
|
||||
# signup start: username + email + password(发送验证码)
|
||||
curl -sS -X POST http://127.0.0.1:8000/api/v1/auth/signup/start \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{"username":"demo","email":"demo@example.com","password":"secret123"}'
|
||||
|
||||
# signup verify: email + token(6位验证码)
|
||||
curl -sS -X POST http://127.0.0.1:8000/api/v1/auth/signup/verify \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{"email":"demo@example.com","token":"123456"}'
|
||||
|
||||
# signup resend: email(重发验证码)
|
||||
curl -sS -X POST http://127.0.0.1:8000/api/v1/auth/signup/resend \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{"email":"demo@example.com"}'
|
||||
|
||||
# login: email + password
|
||||
curl -sS -X POST http://127.0.0.1:8000/api/v1/auth/login \
|
||||
-H 'Content-Type: application/json' \
|
||||
@@ -174,3 +186,5 @@ curl -sS -X PATCH http://127.0.0.1:8000/api/v1/profile/me \
|
||||
| 2026-02-24 | 开发阶段 compose 暂不编排 web/worker,仅保留 redis/supabase 与 init-job |
|
||||
| 2026-02-24 | 新增 dev-app-up 脚本:手动基础设施后,一键 bootstrap + tmux 拉起 web/worker |
|
||||
| 2026-02-25 | 补充迁移防遗漏规则:容器迁移命令统一追加 --build;开发调试优先使用本地 CLI 一次性迁移脚本 |
|
||||
| 2026-02-25 | Auth 注册切换为 OTP 三段式:signup/start、signup/verify、signup/resend;邮件模板改为纯验证码展示 |
|
||||
| 2026-02-25 | 清理未使用配置类:删除 WebSettings/GunicornSettings/WorkerSettings/WorkerGroupSettings(脚本仍使用环境变量启动服务) |
|
||||
|
||||
Reference in New Issue
Block a user