feat: add onboarding setup flow with nickname and password

Replace default auto-generated password with a first-run setup page that
lets users choose their own nickname and password. The /auth/setup endpoint
now accepts an optional nickname field (also sets site_name). Remove
set_default_password() since setup is now mandatory before login.
This commit is contained in:
祀梦
2026-05-17 19:45:36 +08:00
parent bfdf0c9987
commit f838840bda
8 changed files with 330 additions and 27 deletions

View File

@@ -98,7 +98,7 @@ async def auth_middleware(request: Request, call_next):
path = request.url.path
# 不拦截:健康检查、静态文件、公开的 auth 端点
public_paths = {"/health", "/api/auth/login", "/api/auth/logout"}
public_paths = {"/health", "/api/auth/login", "/api/auth/logout", "/api/auth/status", "/api/auth/setup"}
if path in public_paths or not path.startswith("/api/"):
return await call_next(request)