feat: v4.0.1 — onboarding, landing page, smart redirect, register GET, 404 stylé, API unifiée

- Landing page / pour visiteurs non-auth (template landing.html)
- Redirection / intelligente: non-auth → landing, auth sans Gitea → local workspace, auth+Gitea → dashboard
- GET /auth/register — page d'inscription dédiée (tab register actif)
- 404 handler stylisé thème Notion sombre (JSON pour /api/*, HTML pour le reste)
- Alias /api/pages GET/POST → /board/api/pages (307 redirect)
- 133 tests passent
This commit is contained in:
2026-07-20 07:55:09 -04:00
parent 47b0f80dfe
commit 0a675a94f7
4 changed files with 311 additions and 7 deletions
+21
View File
@@ -85,6 +85,27 @@ async function handleLogin(e){e.preventDefault();const email=document.getElement
</html>"""
@router.get("/register")
async def register_page(request: Request):
"""Show the registration page (local login page with register tab active)."""
return HTMLResponse(LOCAL_LOGIN_HTML.replace(
'class="tab active" onclick="switchTab(\'login\')"',
'class="tab" onclick="switchTab(\'login\')"'
).replace(
'class="tab" onclick="switchTab(\'register\')"',
'class="tab active" onclick="switchTab(\'register\')"'
).replace(
'let mode=\'login\';',
'let mode=\'register\';'
).replace(
'id="name-group" style="display:none"',
'id="name-group" style="display:block"'
).replace(
'id="submit-btn">Login<',
'id="submit-btn">Register<'
), status_code=200)
@router.get("/login")
async def login(request: Request, provider: str = Query("gitea")):
"""Redirect to OAuth2 authorize page or show local login page."""