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:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user